#### Archived

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

# Rigid Body Dynamics Question

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

## Recommended Posts

Ok I''ve been getting into rigid body dynamics and I''ve read the articles by Chris Hecker, and the intro by David Baraff. Both people do something very strange in there calculations. It''s when they are taking a force applied at some point r away from the center of mass of the body, and translating in into the overall translational force of the body. They simply state that the applied force is overall force with no alteration at all. I say that the applied force projected onto r is the overall force. My reasoning is that the energy contained within the force must either go into angular kinetic energy or linear kinetic energy, but not both. Thus to component of the appied force that is perpendicular to r would go into rotation (that''s why you use a cross product here), and the remaining applied force, which is necessaily perpendicular to r would go into tranlation (that''s why I say to use a projection). According to Hecker and Baraff, all the enegy going into linear kinetic energy, and some more somehow appears, which is impossible, and goes into angular kinetic energy. So who''s right me or Chris Hecker and David Baraff? Have I missed some crucial fact or something?

##### Share on other sites
Well, well,
i think its just that angular kinetic energy and linear kinetic energy are not mutually exclusive and cannot be added up to give the total force. This is because overall angular kinetic energy ussually always cancels itself out.. (huh?)... for every vector pointing in one direction, there will be one on the exact opp. extreme pointing in the exact opposite direction.

Correct me if im wrong... this is interesting.....

p_samty@yahoo.com

[edited by - psamty10 on February 20, 2004 6:13:48 PM]

##### Share on other sites
Well actually you can verify this by experiment. If you take a pencil and apply a force perpendicular to it's length at the center it will slide in the direction of the force. However if you move away from the center of mass, and say apply the force to the end of the pencil, it will only rotate and not translate. If Baraff and Hecker are correct, I should see my pencil translating and rotating in the second case, but clearly it doesn't.

About angluar kinetic energy, the sign of the objects movement is removed because it's velocity squared, so those opposite vectors will actually add up to a greater number not cancel out. For example, if a spinning object that's not translating hit's you, you'll defintly feel it. This means there must be some kinetic energy transfer going on, which implys the spinning object has kinetic energy.

[edited by - DudeMiester on February 20, 2004 7:25:43 PM]

##### Share on other sites
Read the last section of the "Unconstrained Rigid Body Dynamics" paper by Baraff again. He answers exactly (I think) your question. Make sure you understand how the application of forces leads to a transfer of energy (i.e. "work done = force * distance") - saying "the energy contained within the force" doesn''t make sense...

I''m afraid you''re wrong - sorry! There''s a whole bunch of working physics engines out there that prove it

##### Share on other sites
Rotational K.E doesn''t cancel out becuase it''s a scalar not a vector. for a linear moving body KE = 0.5*m*(v.v) where v is a vector velocity. Now v.v=|v|*|v| >=0 so if I have a body moving at v and another at -v they both have identical energy and thus their combined energy is m*(v.v).

##### Share on other sites
MrRowl I looked through what I think is the section you are refering to. It the one that says if you apply a force to a body for a period of time, the amount of kinetic energy imparted to the body changes depending on where the force is applied. It doesn''t explain why the force applied at a point is translated into the overall force applied to the body without alteration, it simply states that it is. Not only that, how there could be a changing amount of kinetic enegy present in a body depending on where the force is applied, when the force is the same in all cases, I find very perplexing to say the least. Maybe someone could explain this to me, if I am wrong?

As for the engines, of course they would work with both definitions of how force at a point on a body is translated into overall force, and the actual simulations using both definitions would be quite similar. In any case, I can see how it would look "good enough".

##### Share on other sites
I just thought of another question, relating to Baraff''s paper. In the part he deals with colliding contact, he loops through all the contacts appling an impulse if necessary, and loops through again and again until there are no more colliding contacts. I was thinking that this could be also implemented just like how he deals with resting contact. That is by setting up a quadratic problem using velocity rather then acceleration, and then solving for the impulse at each contact. I''m not sure which method is faster, but I think the quadratic way would be more elegent. Actually, I''ve read (most of) his other paper on solving such quadratic problems, and I suspect both method would be about the same speed. I dunno, what do you think about it?

##### Share on other sites
quote:
Original post by DudeMiester
Well actually you can verify this by experiment. If you take a pencil...

Yeah, but try doing it in a frictionless environment and you''ll see that Baraff and Hecker are right. A ruler on an airhockey table might work.

quote:

...
which implys the spinning object has kinetic energy.

It implies that the particles on the edge of the object closest to you have a kinetic energy, yes, but so do all the other particles in the object, even though they are moving in the opposite direction. If you take the mean velocity of all the particles you''ll find that they cancel down to the mean linear velocity of the object.

This question stumped me when I first came across it too - it''s rather unintuitive.

##### Share on other sites
It might be worth trying to think about things from a different perspective: In reality (tm) there''s no such thing as a rigid body, and things like angular momentum/energy are high level concepts. Real bodies are made up of lots of molecules that (a) behave as particles - i.e. they have linear momentum, but their angular momentum is irrelevant (in terms of the behaviour/mechanics of the body as a whole, anyway) and (b) they interact through forces that let them stick together (effectively through "springs" connecting pairs of particles) or collide.

Whilst you don''t have the processing power to simulate every single molecule in a real-world object, you can do an approximation using, for example, 8 particles to represent a cube (one at each corner) with a load of springs/dampers connecting each pair of particles. Each particle only "knows" about linear momentum. However, the system of particles together (if you make the springs sufficiently strong, without making the system go numerically unstable!) exhibits properties like its own linear/angular momentum and kinetic/potential energy. These things are derived properties - mathematical twiddling allows you to state conservation rules etc about the derived properties based on the more fundamental conservation rules applied to the basic particle system.

You can use this idea to do your pencil experiment - either in your head or write a simple program. Represent the pencil by two particles (a structure that has mass, position and velocity, but no concept of orientation/rotation) connected by a very strong spring that acts to keep them a fixed distance apart:

A------spring------B

Initially both particles, A and B, both of equal mass, are setting at rest in space, with no gravity.

Now hit A so that it moves at speed Va in a direction perpendicular to line AB. Since the spring can only impart forces along the line AB, clearly Vb is zero immediately after you hit A.

OK, now think about the system as a rigid body, represented by mass, inertia, position, orientation, linear momentum and angular momentum at a point X, mid-way between A and B.

Clearly, X has a velocity Vx = 0.5 * (Va + Vb) = 0.5 * Va - i.e. the average of particle A and B. Thus the rigid body has acquired a linear momentum.

Also, since A and B are now rotating around X (both move at 0.5 * Va relative to X, but in opposite directions) the rigid body has also acquired angular momentum.

Consequently the single force applied to the system makes it rotate and move.

Hmmm I hope at least some of this makes sense! Anyway, there are a number of people who have got working rigid body simulations based on the idea of representing rigid bodies by a number of particles - the angular aspects of rigid bodies emerge from the more basic particle behaviours. There have been quite a few discussions on gamedev (probably easiest to search for posts by oliii since he often contributes to them and flipcode too. Quite often people get around the problem of needing very stiff springs by using verlet integration, which lets you make the springs be infinitely stiff (but you never actually solve the system exactly!). This is what I did in one of my rigid body experiments:
http://www.rowlhouse.co.uk/carsim
though note that my stuff is a bit more complicated - it actually swaps between the rigid-body behaviour and the collection-of-particle behaviour depending on whether there are any collisions...

quote:
Original post by DudeMiester
I just thought of another question, relating to Baraff''s paper. In the part he deals with colliding contact, he loops through all the contacts appling an impulse if necessary, and loops through again and again until there are no more colliding contacts. I was thinking that this could be also implemented just like how he deals with resting contact...

Yes, you''re right - collisions can either be treated sequentially or simultaneously. However, I forget now exactly why, but I think you can''t use the LCP approach for collisions - only for contact solving. There''s a paper "A fast impulsive contact suite for rigid body simulation" by Schmidl and Milenkovic (I got it off the web but vaguely remember it being tricky to get - mail me if you can''t find it) that uses quadratic programming to solve both for dynamic and static contact resolution. The advantage is that if you solve contacts using this method, then you''re guaranteed that your solution will not result in object interpenetration. If you interate over contacts one by one then sometimes the solution converges so slowly you have to stop before you''re done - meaning that you need to handle object penetration on a regular basis (rather than just some "emergency" code. However, the paper above mentions that using the QP method for dynamic contacts results in incorrect behaviour (presumably because they implemented things incorectly, suggesting it''s pretty tricky!). So they did some passes of the sequential collision method first to get the behaviour looking right, then use QP methods to make absolutely sure!

Incidently, I wrote (and am still playing with!) a rigid body simulator based on the sequential method that is used for both dynamic and static contacts. It also handles other constraints that can be used to set up joints too. And it''s not slow, either (though my implementation has room for a lot of improvement), in spite of being quite simple. Anyway, look for "jiggle" on my web site.

Oh dear, I just wrote far too much

##### Share on other sites
Well thanks for taking the time to write a detailed response, I think I understand it now. It just need to cement in my mind I guess. I can visualize what you mean. Actually repeating my pencil experiment I noticed that indeed I was giving the pencil linear velocity and angular velocity by pushing it, lol.

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
633710
• Total Posts
3013486
×