Back to the Home Page...

Experiments with ODE and Physics


10th August 2004
Until very recently I was playing with the excellent ODE physics system.

I had the idea that computer power might have reached a level where some very impressive Dynamical systems become possible.
The results were interesting but fell short of my target 2000 'bricks' at 30 fps due to problems getting the world to 'sleep' effectively.


The fort is built from about 500 cubes, the large cube in the air is a projectile which has just been fired.




I built an open topped 'box' with staggered rows of bricks, it reacts very nicely to the projectile! (Thrown from inside the box in this picture).

The largest problem I encountered was 'jitter' which seemed to be caused by the high pressure on the lowest row of bricks from all the others above them. I fought with the system for over a month of some very late nights before admitting surrender.

If the jitter problem can be solved, the simulation will go to 'sleep' very quickly, which results in lovely high frame-rates (it's very rare that more than 25% of the bricks in a world are moving or interacting). The trick is to avoid jitter without permitting bricks to 'sleep' in physically implausible locations or orientations.
I tried several solutions including :
- increasing the movement threshold to encompass the 'jitter' motion
(failed due to feedback-like behaviour in the tall walls resulting in occasional large movements)
- detecting the back-and-forth type motion characterised by 'jitter' and ignoring/cancelling those motions
(failed, close examination of movement logs revealed that it may take several frames for the motion to reverse)
- modification of the 'sleep'/'wake up' system to affect only proximate neighbours (so that a 'jitter' movement won't wake up the whole building)
(failed again, I believe the LCP system requires all blocks to be awake to calculate the constraints correctly. This one exploded really well!)
- cheating in the physics so that acceleration due to gravity is not applied until after the physics has run (attempting to avoid the high pressure build up whilst keeping a gravity 'effect')
(failed oddly, this modification seemed to have no effect on the jitter at all yet the force on the lowest bricks was greatly reduced... I wonder if my assumption about the cause of the jitter could be wrong?)
- I also spent a fair amount of time examining the brick/plane collision code and contact logs but could not isolate a particular feature that could correct the problem.
August 10th-12th 2004 - briefly revisited this demo to try out a suggestion made by an ODE mailing list correspondent, I increased the density of the bricks to the equivalent of granite (2600 kg/m3) which gives them a much higher moment of inertia. Unfortunately so far I've been unable to reconcile the massively increased mass of these bricks with the various other settings (they bounce or fall through each other) - more experiments to follow.


Back to the Home Page...