How to apply a quaternion rotation to many objects ?
Jun 21, 2012 at 12:52pm
How to apply a quaternion rotation to many objects ?Hi there, I need to apply a quaternion rotation to many objects. Thus, I have to apply a quaternion rotation to a 3 planes (x,y,z) matrix containing objects positions I need to : Basically, I'd prefer to use only 1 jit.gen to calculate the rotation matrix, then I'll apply the rotation outside of gen world, multiplying the rotation matrix by the positions one. How can I create the 3×3 rotation matrix using jit.gen ? Anyone would help here? [attachment=197165,4071] 

Jun 21, 2012 at 2:04pm
I tried to concatenate my 3 outputs, which provides a 3 triplets elements.. but now, stuck in jit.gen…. Anyone would point me to my problem ..? Any help would be much than appreciate :) [attachment=197171,4072] 

Jun 21, 2012 at 2:09pm
this wouldn't be complete without that. Indeed, I tried to setup the jit.gen param as I thought but maybe the problem comes from here.. [attachment=197173,4073] 

Jun 21, 2012 at 6:04pm
to apply the same quaternion rotation to several objects, you can simply apply the rotation to the parent node (jit.anim.node or jit.gl.node). if this isn’t clear, let me know and i’ll show you an example. 

Jun 21, 2012 at 6:55pm
it is pretty clear Robert. I didn’t explain why I wanted to make that. The matrix to which I need to apply my quat rot is a global named matrix in which I have ALL my objects’ coordinates. 

Jun 22, 2012 at 7:51am
I didn’t even achieve this :( objects coordinates matrix is 3 planes 1xN (N number of objects) how can I … apply this rotation matrix to all my objects …? 

Jun 22, 2012 at 7:04pm
I guess this can work: – Pasted Max Patch, click to expand. –
Copy all of the following text.Then, in Max, select New From Clipboard.
[attachment=197374,4078] 

Jun 22, 2012 at 8:15pm
a little improvement that provides me the way to process the 3 planes resulting matrix in my same jit.gen BUT … the last one is 4 planes… I expected 3. [attachment=197387,4079] 

Jun 22, 2012 at 8:21pm
okay. replacing the last [jit.pack] by [jit.pack 3] and it is okay. 

Jun 23, 2012 at 12:29am
if it seemed to work, I tested and my azimuths aren't correct :( Before to forget about that part and to work on another part because of own saturation, here is exactly what I'm trying to do. I need to calculate azimuth & elevation of objects relatively to my camera direction/plane. So I decided to go to quaternions. The codebox' code comes from this http://fr.wikipedia.org/wiki/Quaternions_et_rotation_dans_l'espace#M.C3.A9thodes_utilis.C3.A9es Why am I thinking azimuth is wrong? It doesn't seem to be the case here :/ Where am I doing wrong ? I'm almost despaired about this part. [attachment=197409,4080] 

Jun 23, 2012 at 12:39pm
I guess the quaternion I’m grabbing is not the good one … I don’t have other explanations and I wouldn’t have more (considering my fresh discovering of quaternion) btw, I can add something which could sound like a clue. 

Jun 23, 2012 at 4:37pm
So, some statements. First, I read this : http://www.gamedev.net/page/resources/_/technical/mathandphysics/quaternionpowersr1095
In my system, as shown on the patch picture, I’m grabbing the cam quaternion and this is that one I convert to matrix and I apply it to all my objects coordinates. I don’t use the temporary vector at all. Maybe my problem comes from here. An user answered me about the fact I didn’t use the temporary vector and it is very interesting for me :
I’m not sure about “incremental rotations around axes” Robert, how should I translate it into my system ? 
You must be logged in to reply to this topic.