Main Menu
Menu

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.

Show posts Menu

Messages - binspaul

#1
Support / Re: load a 3d model
July 20, 2013, 04:57:50 AM
Hello,

I was able to integrate Vuforia with jPCT-AE. I was also able to load the 3D chair model using the code segments described in this thread. But, the model is not rendered correctly. The rear legs of the chair are misplaced. Is it due to the issue in the model or is it because of the FOV (Field of Vision) issue?

When I followed the steps specified in the post: http://www.jpct.net/wiki/index.php/Integrating_JPCT-AE_with_Vuforia for setting up the FOV, the model is disappearing. How can I correct this issue?

Thanks,
Binu Paul.

[attachment deleted by admin]
#2
Support / Re: setRenderHook(shader) not compiling
July 18, 2013, 01:59:50 PM
Hi,

1. I am working on the integration with Vuforia. I was able to load the 3D model of chair using the following code. But, the app is very slow in initializing. is there any method to optimize the integration.

2. I don't want to have the 3D model displayed when I am out of the reference image and want to track when I am on the reference image again. How can I achieve that?

---
/** Called to draw the current frame. */
public void onDrawFrame(GL10 gl)
{
   if (!mIsActive)
      return;

   // Update render view (projection matrix and viewport) if needed:
   mActivity.updateRenderView();

   // Call our native function to render content
   renderFrame();
   
   updateCamera();
   
   world.renderScene(fb);
   world.draw(fb);
   fb.display();
}

public void updateModelviewMatrix(float mat[]) {
   modelViewMat = mat;
}

public void updateCamera() {
   Matrix m = new Matrix();
   
   if(modelViewMat!=null) {
      m.setDump(modelViewMat);
      cam.setBack(m);
   }
}

private Object3D loadModel(String filename, float scale) {
   Object3D o3d = null;
   try {          
      Object3D[] model = Loader.load3DS(mActivity.getResources().getAssets().open(filename),scale);
      o3d = new Object3D(0);
      Object3D temp = null;
      for (int i = 0; i < model.length; i++) {
         temp = model;
         temp.setCenter(SimpleVector.ORIGIN);
         temp.rotateX((float)( -.5*Math.PI));
         temp.rotateMesh();
         temp.setRotationMatrix(new Matrix());
         o3d = Object3D.mergeObjects(o3d, temp);
         o3d.build();
      }
      
   } catch(Exception e) {}
   
   return o3d;
}
---
#3
Hello All,

I have found an issue in the Vuforia and jPCT-AE integration. I was following the steps mentioned in the url: http://www.jpct.net/wiki/index.php/Integrating_JPCT-AE_with_Vuforia.

You will be able to get the 3D cube when the 'Start' button is pressed. When you press the back button, you will reach the start up screen again. When you press the 'Start' button again, the system will throw an exception telling that 'Texture' already exists. You can fix this by checking if we are having a valid texture in the constructor or you can wrap the code in a try-catch block.

---
try {
         
Texture texture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(mActivity.getResources().getDrawable(R.drawable.ic_launcher)), 64, 64));
         TextureManager.getInstance().addTexture("texture", texture);
         
} catch (Exception e) {

}
---

Thanks,
Binu Paul
#4
Hello All,

This is a common issue and this can be fixed by:

1. Copy the .jar file to the 'libs' folder.

2. Make sure that the .jar file is listed in the 'Java Build Path' 'Libraries' tab.

3. Make sure that the .jar file is checked in the 'Java Build Path' 'Order and Export' tab.

4. Take a clean build.

Thanks,
Binu Paul

[attachment deleted by admin]