SHARE
TWEET

ROTATE MATRICE

a guest Apr 18th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top