LapisSea

Untitled

Feb 2nd, 2016
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. Matrix transformation.
  2. CubeModel cube=new CubeModel(0,1,0,1F,2.001F,1F);
  3. Matrix4f rot=new Matrix4f();
  4.  
  5. rot.translate(new Vector3f(0,1,0));
  6. rot.rotate((float)Math.toRadians(40),new Vector3f(0,0,1));
  7. rot.translate(new Vector3f(0,-1,0));
  8.  
  9. cube.transform(rot);
  10.  
  11. cube.draw();
  12.  
  13. OpenGl transformation
  14. CubeModel cube=new CubeModel(0,1,0,1F,2.001F,1F);
  15. GL11.glTranslatef(0, 1, 0);
  16. GL11U.glRotate(0, 0, 40);
  17. GL11.glTranslatef(0, -1, 0);
  18. cube.draw();
Add Comment
Please, Sign In to add comment