Guest User

Untitled

a guest
Apr 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public void reshape(GLAutoDrawable glDrawable, int x, int y, int w, int h) {
  2. System.out.println("### Renderer::reshape w=" + w + "; h=" + h);
  3.  
  4. GL gl = glDrawable.getGL();
  5. gl.glMatrixMode(GL.GL_PROJECTION);
  6. gl.glViewport(0,0,w,h);
  7. gl.glLoadIdentity();
  8. // gl.glFrustum(-1,1,-1,1,0.1f,100.0f);
  9. if(w>h)
  10. glu.gluPerspective(64,w/h,FRUSTUM_ZNEAR,FRUSTUM_ZFAR);
  11. else
  12. glu.gluPerspective(64,h/w,FRUSTUM_ZNEAR,FRUSTUM_ZFAR);
  13. // gl.glGetFloatv(GL.GL_PROJECTION_MATRIX,projectionMatrix,0);
  14. gl.glMatrixMode(GL.GL_MODELVIEW);
  15. gl.glLoadIdentity();
  16. }
Add Comment
Please, Sign In to add comment