Yeah.. That's good reason for bumping 5 months old thread...
It should be sticky, it's nice!![]()
Why do you multiply TargetQuat by the inv(CurrentQuat)? I don't understand how this multiplication equates to rotation.
If I were rotating about the z-axis then the direction of my vector would be (0,0,1)?3. rotationVector(Q) - will return a vector, that direction is the axis, and its magnitude is the angle.
I noticed that torque vectors aren't centered at P2 in my diagram. Where does the game applyTorque to if not P2? Shouldn't the amount of torque you have to apply be dependent on how far you are from the center of an object because you would have more leverage?
This diagram shows what I think would happen which is that the torque vector would be applied at P2 in the direction of the slopes of a circle(or sphere in 3d). Does this have any truth to it?
I've look at wikipedia on gimbal lock but I don't understand why it occurs. In terms of calculations of the angles, why does it spazz out?
Last edited by Cerin; 01-25-2011 at 09:14 PM.
Multiplication "adds" the quaternions together. Division "subtracts" them (gets the difference).
The order of multiplication matters I believe.
This is my understanding. Torque is the same at any point on an entity. The amount of force necessary to produce that torque is what you're talking about, I think. My guess is that applyTorque calculates the force necessary to achieve a certain amount of torque in a specific direction and magnitude
I think, if you were to look at it in those terms, that if P1 is the rotated entities center of mass then P2 has to be the torque vector and magnitude of the torque, or else used to find an angle used in the torque formula. Then with the rest of the formula, the amount of torque and axises of rotation and rotation direction necessary to rotate P1 to P2 is calculated with applyTorque() and applied to P1.
Gimbal lock happens when all three axises of rotation align, resulting in one axis locking up and only being able to rotate on 2 axises from that position, until unaligned.
Your picture looks more like what applyOffsetForce() would do.
Thanks for the pointers... I remember knowing all this stuff, but Im affriad uni only gets longer ago :S
what I wouldnt give to be completely over vector transformations again!... well, I guess I would give the time required, else I would be over them again
who knows, maybe some day
I just finished writing my 3,016 word extended essay on quaternions! THANKS FIZYK![]()
Bookmarks