Skip to content

Instantly share code, notes, and snippets.

@NSDesign
Last active August 12, 2024 16:08
Show Gist options
  • Save NSDesign/d0016a77f678eadd76c5 to your computer and use it in GitHub Desktop.
Save NSDesign/d0016a77f678eadd76c5 to your computer and use it in GitHub Desktop.
VEX : Matrix rotation about a pivot point
f@angle = chf("angle") * 2 * $PI; // angle is a float slider with range from 0 - 1
v@axis = chv("axis") + point(1, "N", 0); // axis is a 3 float vector {0.0, 0.0, 0.0}
3@imatrix = ident();
rotate(@imatrix, @angle, @axis);
@P = (@P - point(1, "P", 0)) * @imatrix + point(1, "P", 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment