Rigid body motion and game physics

AI Thread Summary
The discussion focuses on simulating rigid body motion, particularly rotation without external torque, using Euler's equations in C++. The user seeks numerical solutions to these coupled differential equations without relying on black-box functions like NDSolve. They express interest in how video game physics handle such simulations, noting that approximations are often used for practical purposes. The conversation also touches on the stability of rotation about principal axes and the complexities involved in 3-D motion. A suggestion is made to explore geometric algebra as a potential method for solving these problems effectively.
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:
The rope is tied into the person (the load of 200 pounds) and the rope goes up from the person to a fixed pulley and back down to his hands. He hauls the rope to suspend himself in the air. What is the mechanical advantage of the system? The person will indeed only have to lift half of his body weight (roughly 100 pounds) because he now lessened the load by that same amount. This APPEARS to be a 2:1 because he can hold himself with half the force, but my question is: is that mechanical...
Hello everyone, Consider the problem in which a car is told to travel at 30 km/h for L kilometers and then at 60 km/h for another L kilometers. Next, you are asked to determine the average speed. My question is: although we know that the average speed in this case is the harmonic mean of the two speeds, is it also possible to state that the average speed over this 2L-kilometer stretch can be obtained as a weighted average of the two speeds? Best regards, DaTario
Some physics textbook writer told me that Newton's first law applies only on bodies that feel no interactions at all. He said that if a body is on rest or moves in constant velocity, there is no external force acting on it. But I have heard another form of the law that says the net force acting on a body must be zero. This means there is interactions involved after all. So which one is correct?
Back
Top