[Solved]Camera Problem (and solution)

Hello, I’m a new member of this forum. 



I started out using http://www.jmonkeyengine.com/wiki/doku.php?id=adding_a_chase_camera and have it working on my local.  I then set out to replace the chase camera with a regular camera looking down onto the scene. 



The camera I’ve created does not display the box unless it is above a certain area on the screen (even if it exists in that place in the scene).


cam.setParallelProjection(false);
cam.setFrustumPerspective(45.0f, (float) this.width / (float) this.height, 1f, 400f);
Vector3f camLocation = new Vector3f();
camLocation.x = player.getLocalTranslation().x;
camLocation.z = player.getLocalTranslation().z + zOffset;
camLocation.y = player.getLocalTranslation().y + camHeight;
Vector3f left = new Vector3f( -1.0f, 0.0f, 0.0f);
Vector3f up = new Vector3f(0.0f, 1.0f, 0.0f);
Vector3f camDirection = new Vector3f(0f,-1.0f,0f);
cam.setFrame(camLocation, left, up, camDirection);
cam.normalize();
cam.update();





This is what I see through the camera when the application first runs.  I should see a box where the red circle is located.  The box sitting on the terrain in the scene at this time, and when I move it up a little bit with the keyboard:



The box magically appears.



This red line is an estimate of the border where the camera cannot see the box below.


Please help me adjust my camera, so that I am viewing in this direction, but do not have to contend with this border, below which, boxes turn invisible.  My class is identical to Lesson5.java in every way besides the chase camera, and extends BaseGame if that helps.

You are setting your camera orientation coordinates. The axes must be orthogonal and right handed. You set:



left as -x

up as y

and direction as -y



your up and direction are not at right angles to each other. You should set it along the z axis.



P.S. Welcome to the boards.

Thank you mojomonk! I'll try that out and let you know how it goes!