• Create Account

### #ActualRaidenF8

Posted 28 March 2012 - 04:00 AM

Thank you for your answer alvaro. But yeah, I have tried that too. So, here is what happens to the desired rotation after I convert to Euler angles:

For the half of space that it works:

y goes from -PI/2 to PI/2
x goes from (-PI/2 + alpha) (Looking Down) to (PI/2 - alpha) (Looking up)
Note that alpha exists because the degree of freedom for the camera is limited as we look all the way downwards or upwards.
z is zero

For the half of space that it doesn't work:

y goes from -PI/2 to PI/2
x goes from (PI/2 + alpha) to PI (This is for looking all the way down to looking straight) and from -PI to (-PI/2 - alpha) (This is for looking straight to looking all the way up)
Notice the gap between PI and -PI when looking straight
z has the same kind of behavior as x, only that it is even worse and it has much more gaps. It is either -PI or PI.

So, now you can see what goes bad when it wants to go from current to desired. Because of the gaps and these inconsistencies, it wouldn't know which direction to go, and then it would freak out.

When I say it has a similar problem when converting the quaternion that goes from current to desired into Euler angles, it is because of the fact that these gaps still exist in the converted quaternion.

Thank you for your time, I would really appreciate any help.

### #1RaidenF8

Posted 28 March 2012 - 03:48 AM

Thank you for your answer alvaro. But yeah, I have tried that too. So, here is what happens to the desired rotation after I convert to Euler angles:

For the half of space that it works:

y goes from -PI/2 to PI/2
x goes from (-PI/2 + alpha) (Looking Down) to (PI/2 - alpha) (Looking up)
Note that alpha exists because the degree of freedom for the camera is limited as we look all the way downwards or upwards.
z is zero

For the half of space that it doesn't work:

y goes from -PI/2 to PI/2
x goes from (PI/2 + alpha) to PI (This is for looking all the way down to looking straight) and from -PI to (-PI/2 - alpha) (This is for looking straight to looking all the way up)
Note the gap between PI and -PI when looking straight
z has the same kind of behavior as x, only that it is even worse and it has much more gaps. It is either -PI or PI.

So, now you can see what goes bad when it wants to go from current to desired. Because of the gaps and these inconsistencies, it wouldn't know which direction to go, and then it would freak out.

When I say it has a similar problem when converting the quaternion that goes from current to desired into Euler angles, it is because of the fact that these gaps still exist in the converted quaternion.

Thank you for your time, I would really appreciate any help.

PARTNERS