matrix transformation on a simple 2d or 3d vector (list)
Is there something in between vexpr for simple vector (list) math, and jit.mxform.. for transforming a whole matrix?
e.g. something that allows me to avoid making this in Max:
Figured this one out on my own. Was not as hard as I thought (at least for 2d vectors) and was very satisfying. Here's the solution for posterity...
And... adding the 3rd dimension is trivial.
if you are rotating about the z axis, then z=z, and the above pertains.
If you are rotating about the x axis, then use x=x, and use the formula previously used for x for y and y for z.
If rotating about y: use y=y and shift the others once more, wrapping: y to z and z to x.
The visuals from the link above help.
Oh yeah and angle is in radians (pi radians = 180°)
reminds me of this jitter toy i made back in the days
https://cycling74.com/forums/inverse-kinematics
Wow, great patch!
i've got this for rotation of matrix position data (sorry no time to put it in a nice demo patch, the XYZ rotation order might be jumbled as well)
i rmmbr that one from an old forum thread
here is a clearer example patch
thank you for sharing this!
I love all of you.
short note for anyone stumbling across this, if you're trying to do this with 3D objects using max 6 you can use jit.anim.drive that handles rotations springs and translations pretty painlessly , and most matrix types support @matrix output 2 which outputs the data after its been rotated
I built a large complicated patch in max5 before these features were around, really nice now that they're here
Sweet thanks!
J