Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. class Transform {
  2. PVector model(PGraphicsOpenGL pogl, PVector v) {
  3. return model(pogl, v.x, v.y, v.z);
  4. }
  5.  
  6. PVector model(PGraphicsOpenGL pogl, float x, float y, float z) {
  7. PMatrix3D mv = copyMatrix(pogl.modelview);
  8. mv.apply(m.m00, m.m01, m.m02, m.m03,
  9. m.m10, m.m11, m.m12, m.m13,
  10. m.m20, m.m21, m.m22, m.m23,
  11. m.m30, m.m31, m.m32, m.m33);
  12. return convertCoord(mv, pogl.cameraInv, x, y, z, 1);
  13. }
  14. }
  15.  
  16. PMatrix3D copyMatrix(PMatrix3D m) {
  17. return new PMatrix3D(
  18. m.m00, m.m01, m.m02, m.m03,
  19. m.m10, m.m11, m.m12, m.m13,
  20. m.m20, m.m21, m.m22, m.m23,
  21. m.m30, m.m31, m.m32, m.m33);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement