Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ashunkhs

Pages: [1] 2
1
thank .
Now fixed the issue .

2
FTA

 screen short.

[attachment deleted by admin]

3
Means both looks same .?
there is nothing difference between them .

both are the same model . one looks proper in sample project .but when the code in my project it looks different . what is the problem ?

4
Hi,

  i have attached two image .check out the problem .
  My problem is the model shows semi transparent , it not looks proper .

[attachment deleted by admin]

5
Hi

Any one have idea abut this problem .

Following is my code :


Code: [Select]
world = new World();
world.setAmbientLight(20, 20, 20);

sun = new Light(world);
sun.setIntensity(250, 250, 250);

// Create a texture out of the icon...:-)
TextureManager txtMgr = TextureManager.getInstance();
if (!txtMgr.containsTexture("texture")) {
Texture texture = new Texture(BitmapHelper.rescale(
BitmapHelper.convert(mActivity.getResources().getDrawable(R.drawable.cosmic_pic_05)), 64, 64));
txtMgr.addTexture("texture", texture);
}

tm = TextureManager.getInstance();

cube=loadOBJModel();
cube.calcTextureWrapSpherical();
cube.setTexture("texture");
cube.strip();
cube.build();

//cube.rotateY(-180);
//cube.rotateX(90);

world.addObject(cube);

cam = world.getCamera();

SimpleVector sv = new SimpleVector();
sv.set(cube.getTransformedCenter());
//sv.x += 500;
sv.y += 5000;
sv.z += 1000;

sun.setPosition(sv);

MemoryHelper.compact();
}

private Object3D loadOBJModel() {

Object3D[] model = null;
model = Loader.loadOBJ(mActivity.getResources().openRawResource(R.raw.chinies_obj),
mActivity.getResources().openRawResource(R.raw.chinies_mtl), 1.0f);

return Object3D.mergeAll(model);

}

public void onSurfaceCreated(GL10 gl, EGLConfig config)
    {
        DebugLog.LOGD("GLRenderer::onSurfaceCreated");
       
        // Call native function to initialize rendering:
        initRendering();
       
        // Call Vuforia function to (re)initialize rendering after first use
        // or after OpenGL ES context was lost (e.g. after onPause/onResume):
        QCAR.onSurfaceCreated();
    }

 public void onSurfaceChanged(GL10 gl, int width, int height)
    {
    DebugLog.LOGD(String.format("GLRenderer::onSurfaceChanged (%d, %d)", width, height));

if (fb != null) {
fb.dispose();
}
fb = new FrameBuffer(width, height);
Config.viewportOffsetAffectsRenderTarget=true;
       
        // Call native function to update rendering when render surface
        // parameters have changed:
System.out.println("11111111111111111111");
        updateRendering(width, height);
       
        // Call Vuforia function to handle render surface size changes:
        QCAR.onSurfaceChanged(width, height);
    }
 public void onDrawFrame(GL10 gl)
    {
        if (!mIsActive)
            return;
       
      /*  if(cube!=null)
        {
          cube.animate(anim, 0);
      if (anim>1) {
      anim=0;
      } else {
      anim+=0.01f;
      }
        }*/
        // Update render view (projection matrix and viewport) if needed:
        mActivity.updateRenderView();
       
        updateCamera();
        // Call our native function to render content
        renderFrame();
       
world.renderScene(fb);
world.draw(fb);
fb.display();
    }
   
    public void updateModelviewMatrix(float mat[]) {
modelViewMat = mat;
}
   
    public void updateCamera() {
if (modelViewMat != null) {
float[] m = modelViewMat;

final SimpleVector camUp;
if (mActivity.isPortrait()) {
camUp = new SimpleVector(-m[0], -m[1], -m[2]);
} else {
camUp = new SimpleVector(-m[4], -m[5], -m[6]);
}

final SimpleVector camDirection = new SimpleVector(m[8], m[9], m[10]);
final SimpleVector camPosition = new SimpleVector(m[12], m[13], m[14]);

cam.setOrientation(camDirection, camUp);
cam.setPosition(camPosition);

cam.setFOV(fov);
cam.setYFOV(fovy);
}
}

6
FTA

[attachment deleted by admin]

7
Exactly what is the problem . It is the problem of model or FrameBuffer.

8
Hi ,

   I am working on JPCT+Vuforia integration . My model is rendering well . but problem is that model is semi-transparent by default without any
   setTransparency() call . And it doed't show any effect when i set cube.setTransparency(-1) .



9
Support / Re: loading obj model
« on: May 16, 2013, 09:20:16 am »
Hi sir ,

  I did it but no effect .


      car = loadModel();
      car.strip();
      car.build();
      car.rotateX(180);
      car.rotateY(180);
      car.rotateZ(0);
      car.setTexture("texture");
      car.setTransparency(-1);
      car.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
      
there is any more things ...

10
Support / loading obj model
« on: May 16, 2013, 08:03:48 am »
hi

  i am trying to load object (car.obj)model on surface . its loading but the model become transparent. please check out
  my attached image. we need to set any property ?

[attachment deleted by admin]

11
Support / Re: problem to create object3d model
« on: May 09, 2013, 03:15:53 pm »

i got it .
cube.setName("1"); and
TextureNumber(Integer.parseInt(obj.getName()));

now i am getting always right ID.


thanks......

12
Support / problem to create object3d model
« on: May 09, 2013, 02:10:57 pm »
hi

 i have to create  Object3D model  with object ID 0.
 but when i start app  line1 print object ID->0 but again reopen the app it print ID-->1....and increase one by one .
 so, how to set the object ID ,which always print 0.

Object3D cube_lm= null
cube_up_rt = Primitives.getPlane(9, 9);
         System.out.println("cube_up_rt id-------->"+cube_up_rt.getID());......................line 1
         cube_up_rt.setTexture("eng_text");
         cube_up_rt.rotateY(-60);
         //cube_up_rt.strip();
         cube_up_rt.build();
         cube_up_rt.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
         cube_up_rt.translate(380, 160, 0);

when i do in
onDestry()
{
world.removeObject(cube_up_rt);
cube_up_rt=null;
tm.removeTexture("hebrew_text");
world.dispose();
world = null;
fb.freeMemory();
fb.dispose();
fb = null;
}               and i got the same result.pls help me out.

13
Support / Re: set the scaling on SerializedObject
« on: May 08, 2013, 11:57:18 am »
hi ,
i tried as u told but i did't get any change.
but when i load md2 model i can do the scaling . like this


    sBox = Loader.loadMD2(getResources().openRawResource(R.raw.kingtest), 6.0f);  ...........its scaling
            
   sBox = Loader.loadSerializedObject(res.openRawResource(R.raw.boxmodel));    ..............its not
        sBox.setScale(3f);
   sBox.build();
     
How to do same as SerializedObject.

14
Support / Re: set the scaling on SerializedObject
« on: May 07, 2013, 02:01:53 pm »
Hi ,
 actually i am rendering the PhysicsTest sample on QCAR(Vuforia) . all most my work is complete . its rendering fine on QCAR GL. but i am working half an hour to set the scaling of serialized object. as u told i check the full code . the scaling is not set after this.

           private Object3D sBox;
           sBox = Loader.loadSerializedObject(res.openRawResource(R.raw.boxmodel));
          sBox.build();

   public void addBox(int x, int y, int z) {
         BoxShape shape = new BoxShape(new Vector3f(2, 2, 2));
         float mass = 500;
         Vector3f localInertia = new Vector3f(0, 0, 0);
         shape.calculateLocalInertia(mass, localInertia);

         
         Object3D boxgfx = new Object3D(sBox);
         boxgfx.translate(x, y, z);
         boxgfx.setScale(3f);  .............................................................here...............!!
         boxgfx.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
         boxgfx.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);
         boxgfx.build();
         world.addObject(boxgfx);

         JPCTBulletMotionState ms = new JPCTBulletMotionState(boxgfx);
         RigidBodyConstructionInfo rbInfo = new RigidBodyConstructionInfo(mass, ms, shape, localInertia);
         RigidBody body = new RigidBody(rbInfo);
         body.setRestitution(0.1f);
         body.setFriction(0.5f);
         body.setDamping(0, 0);

         body.setUserPointer(boxgfx);
         boxgfx.setUserObject(body);
         bodyList.add(body);

         dynamicWorld.addRigidBody(body);
      }

for integrating the QCAR i am doing set he modelView matrix on JPCT camera.

15
Support / set the scaling on SerializedObject
« on: May 07, 2013, 11:12:13 am »
     
hi ,
   Actually i have to set scaling on serialized object in PhysicsTest sample  and i am doing this :
 
                                world = new World();
            sBox = Loader.loadSerializedObject(res.openRawResource(R.raw.boxmodel));
            sBox.build();
            sBox.setScale(3f);    // no effect on the model

                               //sBox.setScale(100f);// no effect on the model

            sBox.rotateZ(50);

   But there is no any changes happened.if we can do then how?

Pages: [1] 2