Advertisement
Guest User

ROTATE MATRICE

a guest
Apr 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. vector N = 0;
  2. vector scale = 1; //No difference in scale
  3. vector rot = 0; //Additonal rot
  4. vector pivot = point(2, "P", 0);
  5. vector axis = normalize(point(1, "P", 0));
  6. vector axis_new = cross(axis, {0, 1, 0}); // Get perpendicular angle for rotation
  7.  
  8. float degrees = radians(point(0, "time", @ptnum));
  9.  
  10. matrix3 m = ident();
  11.  
  12. rotate(m, degrees, axis_new);
  13. vector4 orient = quaternion(m);
  14. matrix m2 = instance(pivot, N, scale, rot, orient, pivot);
  15.  
  16. //Apply
  17. @P *= m2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement