Hi everyone!
I am new to JPCT and this is my very first post. I have been integrating AR (vuforia) with JPCT for a while. And everything works fine except for the part of rendering multiple objects( some md2 ).
I add all objects in the same world :
//translation
firstObj.translate(400.0f, 0.0f, 0.0f);
firstObj.rotateZ(90.0f);
firstObj.rotateY(90.0f);
tester.translate(-400.0f, 0.0f, 0.0f);
tester.rotateZ(90.0f);
tester.rotateY(90.0f);
world.addObject(firstObj);
world.addObject(tester);
cam = world.getCamera();
originalMatrix = cam.getBack();
And whenever I receive a new matrix(modelViewMat) from vuforia I move my camera to that specific location :
m.setDump(modelViewMat);
cam.setBack(m);
Here comes my problem, when I move my device camera to a spot where the 2 objects overlap, ideally the one closer to my camera should overlay the further one. But this is not happening to me. Instead, the object which is added later to the world does always appear on top, that is, the tester object in my case.
Is there anything I am missing? What I want is to arrange the order of the objects according to their distance to the camera. Any comments would be very much appreciated, thx!