Advertisement

torque, translational question

Started by April 01, 2002 09:59 PM
4 comments, last by RolandofGilead 22 years, 10 months ago
I had one question but figured it out by reading an article, but I have another. Let''s say we have an object in space that has no external forces acting on it. This object is a ship with thrusters however. When calculating torque, there is a pivot point. For this ship, are the pivot point and center of mass at the same location?
Yes, as long as the ship is rotating as a single rigid body, you should calculate torque about the center of mass and treat the CM as the pivot point.

That is not the only way to do it, but its certainly the easiest, particularly if there are planets with gravity nearby. Make sure you are consistent.




Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Advertisement
I didn''t ask if that was the easiest way to do it. Although I''ll probably do it that way so thank you. Could you mention the other ways please.

Also, the ship is gonna have to be fairly large for the gravity to have significant effects at different ends of the ship.

Oh, and do correct me if wrong, even things like crates would attribute to things like mass and center of mass because say the main engines are firing and the ship is going straight, the friction of the crates on deck would act opposite to the thrust. Also, in this example the crates do not slide(move relative to the ship). In other words the ship''s mass is more than just the superstructure.
quote:
Original post by RolandofGilead
I didn''t ask if that was the easiest way to do it. Although I''ll probably do it that way so thank you. Could you mention the other ways please.


OK. But to reinforce the recommendation to use the CM, it is certainly just as valid as any other approach and results in less math, roundoff error, etc. I could say that its probably the best way to do it. To save headaches at least! Its what the engineering world does much of the time, although certainly the engineering world does other things too. And also isn''t necessarily as clever as it could be!

quote:
Original post by RolandofGilead
Also, the ship is gonna have to be fairly large for the gravity to have significant effects at different ends of the ship.



You''re sort of correct. At least for game physics that is true. In real-world engineering, you must treat the gravitational effects, since the drift in your solution would lead to errors that are significant to engineering design. But for a game you would probably always ignore torque due to gravity, I agree.

Other ways to do this, hmmmmm...?

You can basically calculate your torques about ANY point in space, and treat that reference point as the point of pivot. But any point other than the CM can introduce new terms into the equations that make the math/algebra more detailed and tricky. The torques caused by gravitational fields (discussed above) is one side effect of choosing a pivot point that is not the CM.

The other important thing you sometimes have to deal with (and this may be important even for some games that desire to be realistic) if you choose a pivot point other than CM is that the inertia tensor is different than it is about the CM. That''s right, the inertia tensor about a different point will be different. Its easy enough to use the "parallel axis theorem" to modify the inertia tensor, but the tensor about the CM may have some terms that are conveniently equal to zero (or small enough). Once you transform to a new point, those terms might no longer be zero and this can add more important terms to the equations of motion that can''t be ignored. More calcs, more math. Best to stick with CM to avoid the possibility of mucking things up!

Your equations of motion can be further simplified if you write them in the principle inertia directions (given by finding the eigenvectors of the inertia tensor matrix). The principle inertia directions may be lopsided, off-axis, and not aligned with anything normal like a global x, y, z, or ship-aligned x, y, z. This you probably wouldn''t bother with. This is another example of something (like torque due to gravity) that engineers do but game developers probably don''t want to bother with. The problem here is that although the equations are simpler, you probably end up having to do more vector transformations just to get forces into the principle directions in order to properly calculate the torques, and then transforming your updated orientation back into something meaningful before you draw the ship or do collision detection or whatever.

So part of my description is based on the full math, ignoring nothing, dropping nothing. And in games you can always simplify as much as you want as long as the end result looks the way you want it to. But hopefully you at least have an idea of issues that can appear!

quote:
Original post by RolandofGilead
Oh, and do correct me if wrong, even things like crates would attribute to things like mass and center of mass because say the main engines are firing and the ship is going straight, the friction of the crates on deck would act opposite to the thrust. Also, in this example the crates do not slide(move relative to the ship). In other words the ship''s mass is more than just the superstructure.


Oh, yes, you''re absolutely correct. But it can be tricky if it is possible for the inertial load (including centripetal force and resistance to thrust) to be greater than the frictional load holding a crate in place. The effective mass of the ship could then change instantaneously when the create breaks loose---as you recognized---and if you want to simulate this effect you''d have to deal with the change in mass and in the inertia tensor. The inertia tensor would be different when the crate comes to rest again and when the frictional forces take hold again.

In fact, there''s an interesting concept called "directional mass," which probably doesn''t come up in games too often but comes up frequently in the engineering world. Suppose the crate were on a frictionless rail, so that it could slide freely back in forth in one direction but was constrained in the other two directions. The effective mass of the ship in that case would be less in the direction along which the crate is free to move, but greater in the two directions along which the crate is constrained. This leads to directional mass, which is actually a vector defined in the coordinate system of the rigid body ship. If the frictionless rail could move with respect to the ship, the mass vector would change as the rail rotates, creating a highly nonlinear problem. Wild, weird stuff, eh?



Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Darn it, I should have known what you were gonna say, one, I forgot about being able to calculate torque about any point, two, which is very related to one, I meant is there a wrong point or a right point, but of course there isn''t since it can be calculated about any point. Argh!(Charlie Brown style)

Thank you very much.
No problem! Post some screen shots or a demo sometime! Sounds like a fun game!

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement