Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Transform {
- PVector model(PGraphicsOpenGL pogl, PVector v) {
- return model(pogl, v.x, v.y, v.z);
- }
- PVector model(PGraphicsOpenGL pogl, float x, float y, float z) {
- PMatrix3D mv = copyMatrix(pogl.modelview);
- mv.apply(m.m00, m.m01, m.m02, m.m03,
- m.m10, m.m11, m.m12, m.m13,
- m.m20, m.m21, m.m22, m.m23,
- m.m30, m.m31, m.m32, m.m33);
- return convertCoord(mv, pogl.cameraInv, x, y, z, 1);
- }
- }
- PMatrix3D copyMatrix(PMatrix3D m) {
- return new PMatrix3D(
- m.m00, m.m01, m.m02, m.m03,
- m.m10, m.m11, m.m12, m.m13,
- m.m20, m.m21, m.m22, m.m23,
- m.m30, m.m31, m.m32, m.m33);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement