Rotation values problem

Hi,

I have a wheel initially rotated at 0,0,0 euler angles (the front is oriented towards z-). By pressing the up key RelativeTorque is added, so that it rotates the wheel around the x axis by a certain amount. But what I noticed is that the other global euler angles (y and z) are changing too. The x rotation firstly decrements from 360 to 270 and when it reaches these 270 degrees, the y and z angles instantly become 180 degrees. The process of rotation continues - the x angle starts to increment from 270 and when it reaches 90 degrees y and z angles instantly equal 0, then the x angle decrements from 90 degrees to 360 degrees. And the process starts over. It all takes place with only the up key pressed.
This is extremely frustrating, as I want to add Torque around the y axes, but the y angle changes resulting in irregular rotation around all global axes.
Does anyone know any solution for this problem?

I really start thinking that I will have to quit actualizing my idea. I tried every Quaternion, rotation, rigidbody variables, functions etc. and I feel a bit helpless. Is there really no possibility of rotating an object absolutely globally with each rotation axis completely independent?

I hear your frustration. People cannot help you unless they have a clear idea of the problem. I suggest you post a package with a very simple example of what you are trying to achieve. Then write a clear description of what is going wrong in the example and how you want it to behave when it is working correctly. The whole point of my original comment is that the angles you describe may be meaningless in terms of the problem, and we don't have much more information about the problem.

1 Answer

1

If you are using a rigidbody try locking the Rotation of the axis’s you don’t wish to rotate. You may want to look at this instead of torque.
Rigidbody.AddForceAtPosition

Actually, the first solution won't work, because I want to rotate the object around the other axes, but the rotation around x axis must be absolutely independent and other ones must also be independent. Because, if adding torque around x axis makes the wheel move forward, then to steer with it, it must have torque added around the y axis. Freezing rotation around given axes will simply forbid me to do what I want here. AddForceAtPosition works badly in this case as well, because it also affects the position of the object, not only its rotation.

I also am having single axis rotation issues with rotate and localrotate. [Check this out][1] [1]: http://www.youtube.com/watch?v=crT9cujwBCU&index=26&list=PLCCBAFFC6355DC0DB I hope this gets around so we can solve this. I believe that some of the inexperienced are not seeing this and end up with addressing a problem on top of a problem similar to this.