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?

**1**

# Need Help With Inertial tensor

###
#1
Members - Reputation: **109**

Posted 07 January 2014 - 08:07 PM

###
#2
Members - Reputation: **316**

Posted 08 January 2014 - 03:39 AM

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, 08 January 2014 - 03:43 AM.**

###
#5
Crossbones+ - Reputation: **2130**

Posted 08 January 2014 - 08:09 AM

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

###
#7
Members - Reputation: **1497**

Posted 21 February 2014 - 03:49 PM

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.