Advertisement
Guest User

initCamera()

a guest
Sep 7th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. public void initCamera() {
  2.     float frustumSize = 180;
  3.     camera.setLocation(new Vector3f(0, 0, 0));
  4.     camera.setParallelProjection(true);
  5.     float aspect = (float) camera.getWidth() / (float) camera.getHeight();
  6.     camera.setFrustum(-1000, 1000, -aspect * frustumSize, aspect * frustumSize, frustumSize, -frustumSize);
  7.  
  8.     float f = 35.264f * FastMath.DEG_TO_RAD;
  9.     float f2 = FastMath.QUARTER_PI;
  10.     Quaternion rot = new Quaternion(new float[] { f, f2, 0});
  11.     camera.setRotation(rot);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement