Hi,
I have been facing this problem for quite some time now and now I really need some hints as to what is happening. The scenario is as follows
I am using JME2 and the SWT implementation. I initially set the camera in parallel projection mode and set an isometric view by setting the cam location to 50,50,50 and looking at the origin (0,0,0). This works fine
On resize, i want to update the prespective based on the aspect ratio by setting the frustum values and updating the cam.
Now when this happens, my cam seems to see absolutely nothing.
If I comment out the cam.update() line, it seems fine but then the screen to world coordinate conversion is erroneous!
I am attaching a code snippet below for the cam update function.
float aspect = (float) p.x / (float) p.y;
Camera cam = impl.getCamera(); // impl is the SimpleCanvasImpl instance
float fNear = cam.getFrustumNear();
float fFar = cam.getFrustumFar();
float d = 50f;
float fLeft = -d * aspect;
float fRight = + d * aspect;
float fTop = + d;
float fBottom = - d;
cam.setFrustum(fNear, fFar, fLeft, fRight, fTop, fBottom);
cam.update();
cam.apply();
I am new to jME and have been searching the forum but could not find a proper solution. I would really appreciate any help / hints!
Thanks
Cheers!