Need Help With Inertial tensor

Started by
5 comments, last by Burnt_Fyr 10 years, 2 months ago

HI! Im currently working with Navidia PhysX. I resently encxountered a problem. Im trying to calculate the torque I need to apply to rotetate a Rigidbody between two rotations, over a set time. I find the difference between a target quaternion, and the RigidBody's current rotation, then I convert this into a euler rotation, and multiply by the diagonal of the RigidBody's Inertial tensor. I then convert this into Axis Angle form, and plug it into RigidBody.addTorque(vector). The results im getting from this are incorrect.

MY PROBLEM: The inertial tensor is in body space while the target rotation, and RigidBody rotation are in global space (the addTorque(vector) function also takes a axis angle rotation that is in global space). How do I over come this? Do I need to convert my varables somehow?

Advertisement

If the tensor is a vector or matrix, you could multiply with the inverse transformation matrix of the body you are talking about. This should transform it from body to world space. This works because

A * A^-1 = I

where A is a matrix.

In other words, it's like dividing by itself to get to 1(identity). This has the effect of 'undoing' any transformation and what is left is in 'world' space.

Also, I don't think you need to convert to euler angles, just convert your quaternion to an axis-angle or get it directly. Then you should transform this axis vector by the inverse matrix like I described in the previous post.

Also, if you are working with quaternions, the inverse of a unit quaternion is it's conjugate.

HI! Im currently working with Navidia PhysX. I resently encxountered a problem. Im trying to calculate the torque I need to apply to rotetate a Rigidbody between two rotations, over a set time. I find the difference between a target quaternion, and the RigidBody's current rotation, then I convert this into a euler rotation, and multiply by the diagonal of the RigidBody's Inertial tensor. I then convert this into Axis Angle form, and plug it into RigidBody.addTorque(vector). The results im getting from this are incorrect.

MY PROBLEM: The inertial tensor is in body space while the target rotation, and RigidBody rotation are in global space (the addTorque(vector) function also takes a axis angle rotation that is in global space). How do I over come this? Do I need to convert my varables somehow?

The inertia tensor is not a transformation; it is a property that is related to the distribution of mass about a point. Typically, the inertia tensor is defined about the center-of-mass of a rigid body. If you are trying to rotate about another point then you need to use a different inertia tensor. Fortunately, there is an easy way to do that. The transform, if it needs to be done, should be to apply the torque in the body space.

-Josh

--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet

none of these worked for me sorry.

Seems to me that you just need to use a few matrices to convert back and forth. Your difference quaternion changes an object from it's local orientation to the target one. What space do you think it's in? what space is the inertial tensor in? and finally what space does your torque vector need to be in? Answer these questions and you should have what you need.

This topic is closed to new replies.

Advertisement