camera.setPosition(new SimpleVector(0,-100,100));
camera.lookAt(new SimpleVector(0,0,0));
world.setCameraTo(camera);
SimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,0,0));
The project3D2D returns null or are you getting a NullPointerException??It returns null...
SimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,0.0000001,0));
I get the frameBuffer center, but if I try;SimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,-0.0000001,0));
I get svp==null!The javadoc says:Yes, that's exactly what happens here. Except that the object itself doesn't matter. The view plane is your screen, i.e. z coordinate 0. Everything lower than 0 is in front of the screen (virtually). You can't project that onto the screen correctly. That's why null will be returned.
Returns null if the transformation can't be done (i.e. the center is behind the viewplane)
Is the object visible when rendering and when trying to project its vertex?
SimpleVector svp=Interact2D.projectCenter3D2D(renderBuffer,originSphere);
andSimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,0,0));
both return null!Looking at the code, you may be right. A call to camera.copyBackToFront() should work too. Could you please test this? If it works, i'm going to change the code to work right from the beginning. I'm using the camera's front matrix (the one that has been used for the last render) within this method...i think i remember what i had in mind when doing this...but i also think that this is bulls**t... ;)Yup, camera.copyBackToFront() does it too!