Rigid body motion and game physics

Click For Summary

Discussion Overview

The discussion centers around simulating rigid body motion, particularly rotation, in the context of game physics. Participants explore numerical solutions to the Euler equations of motion without relying on black-box functions, and consider methods used in video game physics for approximating these calculations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks to solve the Euler equations numerically in C++ for simulating rigid body rotation without external torque, expressing a need for a method that avoids black-box solutions.
  • Another participant describes a common approach in video game physics, which involves resolving camera angles and positioning objects based on the player's perspective, iterating through updates for each frame.
  • A participant emphasizes the complexity of computing rotation in 3-D, noting the stability of rotation about two principal axes and instability about the third, referencing the interplay described by the Euler equations.
  • Another contributor mentions that some professionals use geometric algebra for these problems, suggesting it is well-suited for representing and interpolating rigid body motions.

Areas of Agreement / Disagreement

Participants express various approaches to simulating rigid body motion, with no consensus on a single method. There are differing opinions on the necessity of modeling complex rotational behaviors in games.

Contextual Notes

The discussion highlights the challenges of numerical solutions to coupled differential equations and the potential limitations of approximations in game physics. Specific assumptions about the applicability of certain methods in game development are not fully explored.

squeakywaffle
Messages
3
Reaction score
0
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:

http://en.wikipedia.org/wiki/Euler's_equations

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.
 
Physics news on Phys.org
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.
 
wysard said:
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.

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.
 
squeakywaffle said:
I'm more worried about actually computing how the object is rotating... I'm interested in how 'the pros' actually deal with it.

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/

http://www.science.uva.nl/ga/
 
Last edited by a moderator:

Similar threads

  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 21 ·
Replies
21
Views
4K