Newbie Camera View

I’m so used to Xith3D to set the camera location using matrix4f. I trying to move the camera along the x and y axis without affecting the rotation. ( The image remains 2D with sharp edge ). In Xith3D you just need to set the matrix4f values into the camera position. Since there is no function in JMonkey I have tried the following.

  1. setParallelProjection( true ) to mimic a 2D.
  2.    MONKEY_ENGINE.getCamera().setLocation(vec_camera_location);<br />
  3.    MONKEY_ENGINE.getCamera().setRotation(quat);<br />
  4.   MONKEY_ENGINE.getCamera().lookAt(vec_camera_direction, Vector3f.UNIT_Y);<br />

No matter what values I tried, the image still distorted. Can anybody help me on this ?

God Bless
Eng Huat

Try this:


float aspect = (float) cam.getWidth() / cam.getHeight();

float size = 3f;

cam.setFrustum(-1000, 1000, -aspect * size, aspect * size, size, -size);


why dont u use particles? they will make sure the image always looks at the camera.

I am assuming that your image is just a quad.

You’re trying to move the camera, so just use Camera.setLocation()?

Stupid me, Developer you we correct by just using the setLocation works just find for what I need. As for using particles I will just keep things basic as the moment.

God Bless