Sign in to follow this  
ScanCrowRadio

Need Help With Inertial tensor

Recommended Posts

ScanCrowRadio    109

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?

Share this post


Link to post
Share on other sites
Doublefris    316

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.

Edited by Doublefris

Share this post


Link to post
Share on other sites
Doublefris    316

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.

Share this post


Link to post
Share on other sites
jjd    2140

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

Share this post


Link to post
Share on other sites
Burnt_Fyr    1665

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this