Advertisement
olamedia

pmvMatrix

Oct 2nd, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
  2. pmvMatrix.glLoadIdentity();
  3. pmvMatrix.gluPerspective(fov, aspect, zNear, zFar);
  4.  
  5. pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
  6. pmvMatrix.glLoadIdentity();
  7. pmvMatrix.glTranslatef(position.x, position.y, position.z);
  8. pmvMatrix.glRotatef(pitch, 1, 0, 0);
  9. pmvMatrix.glRotatef(yaw, 0, 1, 0);
  10. pmvMatrix.glRotatef(roll, 0, 0, 1);
  11. pmvMatrix.setDirty();
  12. pmvMatrix.update();
  13.  
  14. GL2 gl = GLContext.getCurrentGL().getGL2();
  15. gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
  16. gl.glLoadTransposeMatrixf(pmvMatrix.glGetPMatrixf());
  17. gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
  18. gl.glLoadTransposeMatrixf(pmvMatrix.glGetMvMatrixf());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement