jit.gen & quaternions

Jul 7, 2012 at 1:23pm

jit.gen & quaternions

Hi there,
is there a way to use easily quaternions with jit.gen ??

I need to process a 3 planes matrix with x,y,z space coordinates with jit.gen (which is okay) but my calculation involves quaternions.
Each row of coordinates have to be multiplied by quaternions & quaternions conjugates.

anyone already did that with jit.gen ?
if someone could help even outside of gen, I’d be happy :D

Jul 9, 2012 at 7:47pm

hi julien. below is a patch that rotates vectors by a quaternion using jit.gen.

– Pasted Max Patch, click to expand. –
Jul 9, 2012 at 8:12pm

Hi Robert,
thanks a lot for your patch.
I’ll try it asap in my system.
I’ll grab the quat from jit.anim.node in order to not have problem with gimbal lock coming from euler angles, but I guess the jit.gen calculations remain the same.

posting when I’ll have tested it.

Jul 14, 2012 at 4:42pm

I guess I'm VERY near from my solution.

I'm rotating my vectors by the quaternion rotation.
each vector is made by (objectVector – camVector)

I included your codebox into mine and put the azimuth & elevation calculation in another codebox.

I don't know if it is a problem of vector normalization or whatever, but it still doesn't work.
if I move the camera “around” the object, by keeping the object in the center of my view, I should still have az=0 & el=0 … this is basic and I absolutely don't understand why I don't have that :-(


  1. snapshot.PNG
Jul 19, 2012 at 8:29am

Robert, can I request some help ?
I’m still stuck.
I don’t understand where my logic fails

Jul 25, 2012 at 11:18am

I tried to grab the rotation quaternion of my cam from jit.anim.node, gl.camera .. it doesnt work better
This is a calculation error (in the part I made for sure) and I cannot debug it :-(

Aug 9, 2012 at 8:50am

anyone else would help me ?


You must be logged in to reply to this topic.