Jump to content
• Advertisement

# Dynamics and Rotation

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

If you intended to correct an error in the post then please contact us.

## Recommended Posts

I'm currently implementing the dynamics (as well as learning) but I'm stuck on the rotation. I know that, when a force is applied to a bodys center of mass, the bodys velocity changes, but not the rotational velocity. Now given a force, applied to an arbitrary point P, how does this affect it's velocity and rotational velocity? I think this might not be that easy for complex bodies, but let's assume my body consists of N shapes that can be treated as a point with the mass Xn. How do I calculate the angular velocity for this body? I'm not looking for something fancy/real, it should provide good looking results. [Edited by - SiS-Shadowman on August 17, 2009 1:31:48 PM]

#### Share this post

##### Share on other sites
Advertisement
I'm not a physics expert so maybe I'm missing something simpler, but:

F = force
r = radius
a = angular acceleration
I = moment of inertia
T = torque
* = scalar multiplication
x = vector cross product

T = I * a
T = r x F.

So,

r x F / I = a

Given the center of mass you can compute the vector from the point the force is applied to to the center of mass, giving you r. Your body is simple so you should know the moment of inertia (I), and from that you can calculate the angular acceleration. To have the thing slow down over time instead of constantly accelerating forever, you could just reduce the acceleration slightly each frame, letting it drop below 0 until the rotation stops.

Again physics was always one of my weaker areas, so I'd be more than happy for someone to provide an altnerative.

#### Share this post

##### Share on other sites
You are right.
Inertia is like mass, so I think you don't have to calculate it, just use a value to make your physics look and feel right.
The same with the center off mass I think.
But wiki as always

#### Share this post

##### Share on other sites
Thanks for the quick explanation, I do have more questions though.
I think it boils down to the question: how do I express the measures that are involved in an objects rotation / angular velocity / Moment of Inertia in my game? Like with simple newtonian dynamics, my object has a position, a velocity and a mass. When doing the dynamics and I want to apply a force, I simply divide my force by the timestep and add that to the current velocity. Then I do the same with the velocity and add that to my position.
But I'm clueless what I need to do with the rotational part. From the first article mentioned, I got that I would need to store the Moment of inertia tensor, but apart from that I don't really have a clue.

Another thing I didn't get is how would that force change my bodys velocity?

[Edited by - SiS-Shadowman on August 17, 2009 1:25:06 PM]

#### Share this post

##### Share on other sites
Check out these articles (you can probably find more) http://chrishecker.com/Rigid_Body_Dynamics#Physics_Articles

Implementing a full 3D rigid body simulation is not a simple task at all, good luck :)

#### Share this post

##### Share on other sites
Thanks for that link. I've just read article 1 and 2, however something really bugs me:

Quote:
 1. Calculate the CM and themoment of inertia at the CM.2. Set the body’s initial position,orientation, and linear and angularvelocities.3. Figure out all of the forces onthe body, including their points ofapplication.4. Sum all the forces and divide bythe total mass to find the CM’s linearacceleration (Eq. 5).5. For each force, form the perpdotproduct from the CM to the point offorce application and add the value intothe total torque at the CM (Eq. 11).

#4 basically claims that no matter where I apply a force on the body, it's linear velocity will always be the same. However I cannot agree with that. When I apply my force to the center of mass, all that force is used to change the linear acceleration only, but not the angular. If I apply my force to the outer edge of a sphere, for example, then (ideally) it's linear acceleration would not change, only the angular one.
Am I missing something or is this part wrong?

#### Share this post

##### Share on other sites
I think it's just language abuse, you're right that depending on the point of application and angle of the force, part of the energy is transferred as linear moment, and part of it as angular moment.

#### Share this post

##### Share on other sites
we're talking about rigid bodies here, when you apply the force off center, the rigid body condition forces the body to rotate. I don't think you can say that the force is split in a linear and angular part. You could talk about kinetic energy in linear motion and rotation energy, this can be split. When you apply the force in the center, we could say the work done is f*ds (distance) , but if you apply the force off center the f*ds changes because the body starts to rotate. Hopefully someone can answer this more clearly.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
19
2. 2
3. 3
JoeJ
16
4. 4
5. 5
• Advertisement

• 26
• 20
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631700
• Total Posts
3001782
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!