User Tools

Site Tools


ai:patches:eulertoquaternion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ai:patches:eulertoquaternion [2018/12/04 16:08] – created icke_siegenai:patches:eulertoquaternion [2018/12/04 16:20] (current) – external edit 127.0.0.1
Line 21: Line 21:
 However, there is an extensive explanation in the a.m. example: However, there is an extensive explanation in the a.m. example:
  
-When creating this project I ran into a strange problem: x, y, and z rotation are no independent from each other. I described it like this: +>When creating this project I ran into a strange problem: x, y, and z rotation are no independent from each other. I described it like this:
- +
-> in AI, the x and y rotation of a screen fixture refer to the world’s x and y axis. However, z rotation refers to the screen’s z axis. This leads to the situation – with x_rot = -90 – that y_rot and z_rot do exactly the same, but the screen cannot be tilted sideways (what z_rotation does). +
- +
-Dave Green was kind enough to give a thorough explanation of this: +
- +
-> You have discovered one of the draw backs of the Euler angle system we use in to rotate screens in Ai.  Gimbal Lock.  There is a short video explaining the problem here: https://www.youtube.com/watch?v=zc8b2Jo7mno.  The advantage to using the Euler system for angles is that everybody understands it.  But the trade off is that it has limitations in the form of gimbal lock.+
 > >
->So you are probably thinking what can I do to resolve this problem?  Well the simplest option is to have a second version of your model which is 'pre-rotated' by 90' on the x axis.  That will allow your z rotation to function as you expect That might not be the solution you need in this case, but it is a common solution to the problem.+>... in AI, the x and y rotation of a screen fixture refer to the world’s and y axis. However, z rotation refers to the screen’s z axisThis leads to the situation – with x_rot = -90 – that y_rot and z_rot do exactly the same, but the screen cannot be tilted sideways (what z_rotation does).
 > >
->Another option is to use the alternate skin for the Fixture in the stage patch and then connect to the x,y,z,w Quat ports.  I believe these allow you to rotate the fixture using quaternion rotation.  Only problem is I just tried this and I have no idea what data you need to feed into it.  I know this solves this problem though if you can work out what to feed into it.  Ciaran may be able to elaborate here as he added these ports.  There is a short video explaining quaternion rotation here: https://www.youtube.com/watch?v=SCbpxiCN0U0 you should be able to take some math / trig modules in salvation and replicate the conversion detailed in this video if you are feeling brave ;) +>Dave Green was kind enough to give a thorough explanation of this: 
- +
-And while I was still struggling to find my way through all this Ciaran was so kind to create a patch which is now included as system patch: +
- +>> You have discovered one of the draw backs of the Euler angle system we use in to rotate screens in Ai.  Gimbal Lock.  There is a short video explaining the problem here: https://www.youtube.com/watch?v=zc8b2Jo7mno.  The advantage to using the Euler system for angles is that everybody understands it.  But the trade off is that it has limitations in the form of gimbal lock. 
->As Dave has said you encounter this problem based on the way Euler angles are defined in Euclidean Space. To get around this we can either use a 4x4 rotation matrix or quaternions. Without getting into the maths too much I have created a patch that should convert your Euler Angles into Quaternions, giving you back full 3 degrees of rotation.+>> 
 +>>So you are probably thinking what can I do to resolve this problem?  Well the simplest option is to have a second version of your model which is 'pre-rotated' by 90' on the x axis.  That will allow your z rotation to function as you expect.  That might not be the solution you need in this case, but it is a common solution to the problem. 
 +>> 
 +>>Another option is to use the alternate skin for the Fixture in the stage patch and then connect to the x,y,z,w Quat ports.  I believe these allow you to rotate the fixture using quaternion rotation.  Only problem is I just tried this and I have no idea what data you need to feed into it.  I know this solves this problem though if you can work out what to feed into it.  Ciaran may be able to elaborate here as he added these ports.  There is a short video explaining quaternion rotation here: https://www.youtube.com/watch?v=SCbpxiCN0U0 you should be able to take some math / trig modules in salvation and replicate the conversion detailed in this video if you are feeling brave ;) 
 +> 
 +>And while I was still struggling to find my way through all this Ciaran was so kind to create a patch which is now included as system patch: 
 +> 
 +>>As Dave has said you encounter this problem based on the way Euler angles are defined in Euclidean Space. To get around this we can either use a 4x4 rotation matrix or quaternions. Without getting into the maths too much I have created a patch that should convert your Euler Angles into Quaternions, giving you back full 3 degrees of rotation.
  
 {{:ai:patches:eulertoquaternion.png?450|}} {{:ai:patches:eulertoquaternion.png?450|}}
  
ai/patches/eulertoquaternion.1543939732.txt.gz · Last modified: 2018/12/04 16:08 by icke_siegen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki