## jit.gl.handle --> jit.p.vishnu rotation conversion

May 20 2007 | 10:51 pm
hi,
ive set up a particle system to fire particles in a straight line, im trying to rotate this in relation to jit.gl.handle's rotation, ie spin a jit.gl.handle's object and the angle the particles are firing along rotates too.
to do this ive got to convert from jit.gl.handle's angle/axis to jit.p.vishnu's pitch/yaw. From what ive read i think pitch and yaw are euler angles and axis angle is self explanatory!
Ive come across this super complicated explanation of how to manage these conversions
but i was hoping someone might have some javascript code to help me out! or maybe theres a simpler way of going about this,
thanks, will

• May 20 2007 | 11:17 pm
Have you tried looking at jit.gl.handle's rotatexyz attribute? The problem with converting to euler angles is that they don't describe all possible 3D orientations, so there's ambiguity.
wes
On 5/20/07, will wrote: > > hi, > > ive set up a particle system to fire particles in a straight line, im trying to rotate this in relation to jit.gl.handle's rotation, ie spin a jit.gl.handle's object and the angle the particles are firing along rotates too. > > to do this ive got to convert from jit.gl.handle's angle/axis to jit.p.vishnu's pitch/yaw. From what ive read i think pitch and yaw are euler angles and axis angle is self explanatory! > > Ive come across this super complicated explanation of how to manage these conversions > > http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToEuler/index.htm > > but i was hoping someone might have some javascript code to help me out! or maybe theres a simpler way of going about this, > > thanks, will >
• May 20 2007 | 11:30 pm
maybe try and simplify first, and then add in complexity.
the following patch will take an angle of rotation, which can be received from gl.handle or from wherever, and calculates the x and z components of the initial velocity (which can be sent to shiva).
you can increase the magnitude of the velocity as indicated in the patch.
this patch assumes you are only concerned with rotations around the y axis. i would not use handle to get the angle of rotation, i would use sliders and send the angle to both the object, and the particle system. you can move around the particle system by sending values to the 2nd, 3rd and 4th elements of the pak.
-rob
• May 21 2007 | 1:47 pm
Hi Rob,
Thanks once again for your help- ive finally figured out how to plumb it into my patch and all is rotating well around the y axis, do you know of a way to get the x y and z (compnents of initial velocity) all working so the particles can fly out on all axis's using something similar to your patch- or could you tell me what i should be looking at/reading up on!
i dont need to necessarily use jit.gl.handle as long as the angle format used can be fed to a jit.gl.model without to much fuss
cheers
• May 21 2007 | 5:58 pm
i would highly recommend you check out the advanced camera example patch. examples/jitter-examples/3rd_Party/AdvancedCamera.pat
very clearly demonstrates how to do 3d transforms using jitter matrices. it's a little daunting, but worth studying.
other than that, as wes suggested, try using rotatexyz instead of rotate. maybe you can just duplicate the poltocar math and for the rotation around x or z to determine the y-component of the velocity. let me know what you come up with. -rob
• May 22 2007 | 7:25 am
will skrev: > hi, > > ive set up a particle system to fire particles in a straight line, im trying to rotate this in relation to jit.gl.handle's rotation, ie spin a jit.gl.handle's object and the angle the particles are firing along rotates too. > > to do this ive got to convert from jit.gl.handle's angle/axis to jit.p.vishnu's pitch/yaw. From what ive read i think pitch and yaw are euler angles and axis angle is self explanatory! > Hi Will, I was just looking through the Jamoma "components" and noticed an abstraction called "jcom.aed2xyz" and another one called "jcom.xyz2aed" - maybe these will help you?
Andreas.
• May 22 2007 | 12:33 pm
Hi Andreas, thanks for the info, ive installed these components but cant work out what the eul part of xyz2eul is and trial and error isnt helping me out today!
Ive figured out a way of rotating a central shape around 2 axes, and sending this to vishnu's pitch and yaw to get the particle's emmission angle to mirror the central shape, this is fine for 2 axes but as soon as i introduce a third it gets messy.
Heres my patch if anyones interested (or needs to only use 2 axes) (its hacked together from help files and a particle system from the forums, thanks to the makers!)
////////////////
I think all thats needed is for my Z axis to alter pitch and yaw in relation to the X and Y axis but trail and error maths isnt proving too fruitful atm.