PDA

View Full Version : Node rotation.y_rotation property limited to +-90 degrees?


amv256
10-21-2007, 12:37 AM
I've been writing a simple script for rotating a box around different axes to test an idea and have run into a strange problem. It seems that the box's rotation.y_rotation property can't be incremented beyond +- 90 degrees. If I attempt to do so, the amount by which I'm incrementing is instead subtracted.

So, for example, if I'm adding a series of keyframes to the box, wherein each keyframe increments y_rotation by 2 degrees, I might see this pattern:

...
y_rotation = 84
y_rotation = 86
y_rotation = 88
y_rotation = 90
y_rotation = 88
y_rotation = 90
y_rotation = 88
y_rotation = 90
...

This doesn't happen with x_rotation or z_rotation.

Any ideas what's going on? I've been testing this for the last couple hours from all angles and can't figure out what it is. The help reference doesn't seem to have anything to say about this either (nor does Google).

RustyKnight
10-22-2007, 01:26 AM
I'm probably not the best person to answer this is question, as I bearly understand what is going on.

I think if you also output x and z angles, I think you will find that they are been updated/changed as the object passes the 90 degree point.

If I understand correctly, the rotation of the object is made up of matrix based on the rotation order of the controller (normaly, xyz). As I understand it, this means that the values are been applied mathamatically together (under some really cool process that I'm not even going to try and pretend to understand) which produces the overall rotation of the object...of course I could be completely mistaken...but when I get simular results as you, this is the normally the reason.

Bobo has some really good information about it, so it would worth searching around for that!

Shane

Gravey
10-23-2007, 01:37 PM
i have no idea why it doesnt work either BUT this does:
-- minus equals seems to be for adding to the current rotation
$.rotation -= (eulerangles 0 2 0) as quat
-- and plus equals seems to be for subtracting from the current rotation
$.rotation += (eulerangles 0 2 0) as quat

hope this helps

CGTalk Moderation
10-23-2007, 01:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.