notrodash

Untitled

Jul 9th, 2012
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. public void render()
  2.     {
  3.         GL11 gl = Gdx.gl11;
  4.        
  5.         float centerX = (float)(MathUtils.cosDeg(yaw));
  6.         float centerY = 0;
  7.         float centerZ = (float)(MathUtils.sinDeg(yaw));
  8.         System.out.println(centerX+" "+centerY+" "+centerZ+" ~ "+GDXRacing.camera.position.x+" "+GDXRacing.camera.position.y+" "+GDXRacing.camera.position.z);
  9.         Gdx.glu.gluLookAt(gl, GDXRacing.camera.position.x, GDXRacing.camera.position.y, GDXRacing.camera.position.z, GDXRacing.camera.position.x+centerX, GDXRacing.camera.position.y+centerY, GDXRacing.camera.position.z+centerZ, 0, 1, 0);
  10.        
  11.         if(Gdx.input.isKeyPressed(Keys.A))
  12.         {
  13.             yaw++;
  14.         }
  15.         if(Gdx.input.isKeyPressed(Keys.D))
  16.         {
  17.             yaw--;
  18.         }
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment