How to rotate a vertex position matrix with angle-axis input

Jun 13, 2012 at 2:02pm

How to rotate a vertex position matrix with angle-axis input

Hi,
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?

Tanx, D.

#46624
Jun 13, 2012 at 2:14pm

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.

#167725
Jun 13, 2012 at 3:04pm
#167726
Jun 13, 2012 at 4:00pm

I should be able to max-ify that. Tanx!

#167727
Jun 13, 2012 at 6:12pm

couple things to mention.
there are max 6 native versions of the quaternion objects.
jit.quat
jit.quat2euler
jit.euler2quat
jit.quat2axis
jit.axis2quat

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.

#167728
Jun 13, 2012 at 7:02pm

tanx!

> 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…

#167729
Jun 21, 2012 at 12:33pm

dtr, I’m interested, by your final solution.
jit.gen ?

#167730
Jun 21, 2012 at 12:51pm

Hey, I didn’t implement it yet. It’s on my list for optimization steps but got more pressing issues right now…

#167731
Jun 21, 2012 at 12:54pm

argh :)
all forces with you!

on my side, playing with quaternions.. I’ll post my stuff soon

#167732
Jun 21, 2012 at 1:00pm

Thanks! 4 days till graduation exam performance, gotta weave all those loose threads together in a solid fabric…

#167733

You must be logged in to reply to this topic.