How to rotate a vertex position matrix with angle-axis input
I haven’t been able to work this one out. How do I rotate a matrix with XYZ position data with an angle-axis vector (a,x,y,z) as input? Is there an external that does this?
Ok I found one solution in Graham Wakefield’s quat externals: [axis2quat] and [quatpov]. This forces me to to iterate through the matrix cells though. Is there a solution that transforms the matrix data directly? With the right math code I could make a jit.gen operation as well.
Perhaps this helps :)
I should be able to max-ify that. Tanx!
couple things to mention.
there are max 6 native versions of the quaternion objects.
if your matrix of vertices came from an jit.gl object in matrixoutput mode, you can apply a rotation to the object itself and use @matrixoutput 2, to output the transformed vertices.
but otherwise, you should be able to construct a gen patch that takes a quaternion as a parameter, and transforms the vertices appropriately.
> if your matrix of vertices came from an jit.gl object in matrixoutput mode, you can apply a rotation to the object itself and use @matrixoutput 2, to output the transformed vertices.
I know but this is exactly to work around the lack of matrixoutput in jit.gl.mesh…
dtr, I’m interested, by your final solution.
Hey, I didn’t implement it yet. It’s on my list for optimization steps but got more pressing issues right now…
all forces with you!
on my side, playing with quaternions.. I’ll post my stuff soon
Thanks! 4 days till graduation exam performance, gotta weave all those loose threads together in a solid fabric…