Then we set the camera ten units to the right, and units up and ten units back.
public class Basic3dtest implements Applicationlistener {public
perspectivecamera cam;
@Override public
Void Create () {
cam = new Perspectivecamera (Gdx.graphics.getWidth (), Gdx.graphics.getHeight ());
Cam.position.set (10f, 10f, 10f);//x right positive y upward for positive z want to be positive
Cam.lookat (0,0,0);
Cam.near = 1f;
Cam.far = 300f;
Cam.update ();
}
...
}
Here we create a new perectivecamera with a field of view of degrees (which are common to use) and we set the aspect rat Io to the current width and height. Then we set the camera ten units to the right, and units up and ten units back. The z axis is pointing towards the viewer and so for the viewer a positive Z value of the camera was moving the viewer back. We set the camera to look at (0,0,0) because, where we are placing our 3D object to view. We set the "near" and "far" values to make sure we would always see our object. And finally we update the camera so all changes we made is reflected by the camera.