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

#39881
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. –
#140636
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.

#140637
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 :-(

[attachment=199341,4181]

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

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

#140639
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 :-(

#140640
Aug 9, 2012 at 8:50am

anyone else would help me ?

#140641

You must be logged in to reply to this topic.