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??
SimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,0.0000001,0));
SimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,-0.0000001,0));
The javadoc says: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);
SimpleVector svp=Interact2D.project3D2D(camera,frameBuffer,new SimpleVector(0,0,0));
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...