Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Rigid body motion and game physics

  1. Mar 12, 2008 #1
    I am just playing around with physics simulation in c++... and my latest obsession is simulating rigid body motion (specifically rotation) with no external torque, for now. The equations of motion in question are the 'Euler equations' which relate the angular acceleration (omega-dot) around any principal axis to the angular velocity around the other two principal axes and the moments of inertia about all three:


    So it's a system of coupled differential equations. My question is... does anyone know how to solve a system like this numerically without using some black-box function like NDSolve in Mathematica (I need to be able to implement it in c++)?

    Or, if not, does anyone know the method used to solve problems of this kind in video game physics? I suspect that some kind of approximation is used in most cases. My eventual ambition is to write a simple flight simulator, so I don't need extreme accuracy- just the illusion of reality.

    I did some quick searches but I couldn't find anything. I would really appreciate it if anyone can shed some light on this.
  2. jcsd
  3. Mar 12, 2008 #2
    In a video game scenario the solution is generally to resolve camera angles from the perspective of the player. As a result (having done this programming from time to time) is to position all the objects in the universe and then clip for what is in front of the "camera" / player and then rotate and translate for the current frame. Update the player (camera) point of view in the universe and then iterate through the cycle again.
  4. Mar 12, 2008 #3
    I'm not really worried about how I will eventually implement the camera view... my concept of it right now is to simply attach the camera to a physics object that is translating/rotating through the world's coordinate system (or anywhere else). I've done this in the past and probably would do it the same way again since it allows more flexibility in placing the camera.

    I'm more worried about actually computing how the object is rotating, in this case as a result of torques caused by airflow over the various lifting and control surfaces. The problem comes when a rigid body is rotating in 3-D, because rotation about two of its principal axes is stable and the other is not (you can test this by tossing a book in the air), and there is complex interplay (described by the Euler equations) between the angular velocities about each principal axis.

    At least, that's the way I understand it. Obviously if I was an expert, I would have figured this out by now. I don't think this behavior necessarily has to be modeled in-depth for a game (if your plane is spinning fast enough to notice these effects, you might be screwed) but I'm interested in how 'the pros' actually deal with it.
  5. Mar 13, 2008 #4
    I am not a pro but I know that some of the pros use geometric algebra, which is well-tailored to this type of problem. An excellent source is "Geometric Algebra for Computer Science" by
    Dorst, Fontijne, and Mann (Morgan Kaufmann series in computer graphics, 2007). Chapter 13 (The conformal model: operational Euclidean geometry) explains the basic methods,
    including an exercise on interpolation of rigid body motions: translation and rotation are represented as exponentials of bivectors, allowing easy interpolation. For more information:

    http://www.geometricalgebra.net/ [Broken]

    http://www.science.uva.nl/ga/ [Broken]
    Last edited by a moderator: May 3, 2017
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Rigid body motion and game physics