Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I'm creating a game in which the user directly controls the tilt of a platform.

Since most of the time we will be balancing and controlling a ball, this means large angles and full rotational freedom are not important, so the issue of gimbal lock is avoided.

So, I would like my control algorithm to use only Euler angles rather than quaternions, to keep things as simple as possible. The "problem" is that the physics engine uses quaternions to store the orientation, and in addition to this, I must specify the angular velocity of the motion, otherwise collision response is incorrect.

I want to control the orientation of a rigid body in the physics engine using two angles derived from user input, which correspond to pitch and roll. Yaw is ignored.

I have a routine to compute the euler angles from a quaternion. So, I now have two angles which measure how much the rigid body must roll and pitch to match input data.

By assigning the angular velocity to approach the target values I should be able to get the rigid body to closely follow input, and by doing this get correct behavior (rather than directly setting the orientation quaternion directly, which provides zero angular velocity information to the physics engine, and messes up contact response).

But I have what are essentially two angular velocity pseudo-vectors which I need to combine together.

Do I simply sum $\omega_{roll}+\omega_{pitch}$ ? I know that two rotations do not commute. In the limit of small rotations (which is one way to look at what angular velocity represents) commutativity does exist. So does this mean that the result will be off slightly? By how much? Will it be the same amount off compared to the two ways to compose the individual Euler-rotations?

It's frustrating not to be able to visualize these quantities due to the three dimensional nature of it. Maybe somebody has created a Mathematica interactive demo or something of that sort, related to this topic. That would be cool.

share|improve this question
    
I'd suggest this question would go better over on gamedev.SE rather than here; that said, if you're trying to do rigid-body physics, then quaternions are as simple as possible; Euler angles will turn out to be much messier on several fronts. Angular velocities are effectively a degenerate quaternion, with 0 w component (i.e., a vector); luckily you can just sum them, essentially because as infinitesimal quantities the non-commutativity that charaterizes composition of rotations goes away. –  Steven Stadnicki Oct 23 '12 at 22:11

1 Answer 1

The sum of two angular momentum vectors is simply the summed components in Cartesian coordinates (if this were not true, the angular velocity would no be a vector in $\mathbb{R}^3$) If: $$\vec{\omega}_{roll}=(0,0,\omega_r), ~\vec{\omega}_{pitch}=(0,\omega_p,0), ~$$ Then: $$\vec{\omega}_{roll}+\vec{\omega}_{pitch}=(0,\omega_p,\omega_r), ~$$ Of course, if for some reason the vectors are given to you in some other coordinate system (say spherical coordinates), then you'll have to transfer back to Cartesian, add, and then transform back.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.