#### Archived

This topic is now archived and is closed to further replies.

# Using torque+angular impulses to actually get a rotation

This topic is 5366 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m happy with applying a force to get a torque which causes angular acceleration in 2D. I can do the maths easily in 3d to get a torque vector but then I''m unsure what to do next. I''ll have a torque vector and a moment of inertia vector but what do I do with them to get an actual rotation quaternion/matrix. I think the torque vector is the axis about which the angular acceleration takes place? Many thanks.

##### Share on other sites
you can have a look at this

box on plane physics

##### Share on other sites
Thanks but too lazy to download right now! Is it code or words?

The other related thing: if I apply many forces to a body, getting many torques, can I just add their vectors to get the total torque on the body?

##### Share on other sites
it''s code. One CPP file, commented. It''s a box falling on a plane and resting.

for torques and forces, yeah, you can accumulate them together, and then when you integrate, use the accumulated value.

##### Share on other sites
Another thought...
moment of inertia for say a cylinder or box is only easy to know along certain axes. If a torque is applied on an arbitrary vector the rotation axis isn''t on one of these so how do I know what I to use? Can I resolve each torque into 3 along the object''s local axes and do it that way or would the rotation get screwed up?

##### Share on other sites
that''s what the inertia matrix is used for. it puts the right amount of angular momentum around the axes of the shape, if you will. you should not have to worry about it though.

The angular velocity vector defines the axis of rotation, and the angular velocity of rotation along that axis. I never got it to work like that though. You can give it a go, instead of using the quaternion malarkey I''m using.

##### Share on other sites
Wow...I just kept watching that demo over and over. I wish there was a reset button, or some way to mess around with the box. Cool thing Oliii!

- Aeroum

##### Share on other sites
if you like it, you can try the other demos

[edited by - oliii on February 9, 2004 4:19:20 AM]

##### Share on other sites
Wish I''d just looked at your code in the 1st place now! Despite using it at work for physics modelling I forgot we use a matrix for I not a vector!
When you get your inverse I matrix which way round is the multiplication going? Is the idea you multiply torques by the orientation matrix then by the invI matrix then get back to world coords?
One little thing, with your integration why do you update the velocity then use the new velocity along with acceleration to get new position? Shouldn''t you use the current velocity with the acceleration, then update the velocity after?

Thanks.

##### Share on other sites
quote:
Original post by d000hg
Wish I''d just looked at your code in the 1st place now! Despite using it at work for physics modelling I forgot we use a matrix for I not a vector!
When you get your inverse I matrix which way round is the multiplication going? Is the idea you multiply torques by the orientation matrix then by the invI matrix then get back to world coords?
One little thing, with your integration why do you update the velocity then use the new velocity along with acceleration to get new position? Shouldn''t you use the current velocity with the acceleration, then update the velocity after?

Thanks.

for the integration, you''re right. My physics can be a bit wobbly at times, but I''m getting better

for the toqrues and force calculation, everything is done in world coordinate system. You can very well do the calculations in local coordinates, but that''s more work. To do force and torques and integration into world coordinate system, I just need an inertia matrix also in world coordinate system, then the collision impulse and integration are all resolved in a simple world frame, for every objects.

to get the inertia matrix from local coordinate, to world coordinate, you convert the matrix from local to world coordinates (MTX = Box.Inertia * Orientation.Inverse()), and then orient the inertia matrix with the box orientation (Orientation * MTX).

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 13
• 70
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632967
• Total Posts
3009571
• ### Who's Online (See full list)

There are no registered users currently online

×