[Solved] Suitable values (jumpy and exploding simulation)
-
- Posts: 21
- Joined: Sun Jan 27, 2008 10:56 am
- Contact:
[Solved] Suitable values (jumpy and exploding simulation)
Hi, I'm kind of curious on whats recommended values for simulations? I'm currently using 1000 constraint iterations and 4 steps each frame (framerate is about 60) and it's still jumpy and explodes once in a while. The world I'm using is 800x600 grav: 98.1 damp 0.9 i have two bodies 4 verices each and 3 segments around the bottom half of the screen. Friction on all bodies are between 0.5 and 1.0. Is there any other value that could be messing things up?
Last edited by Kingdom Of Fish on Mon Feb 04, 2008 7:27 pm, edited 1 time in total.
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Suitable values
Woah. Something is amiss there for sure. I generally use 10-20 iterations and 1 or 2 substeps. Can you expand upon what you are doing?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 21
- Joined: Sun Jan 27, 2008 10:56 am
- Contact:
Re: Suitable values
I've currently just set up a scene to construct my xml and resource loading classes so I just have the scene as in my first post. I'll try to show what happens with different values.
-
- Posts: 21
- Joined: Sun Jan 27, 2008 10:56 am
- Contact:
Re: Suitable values
http://video.google.com/videoplay?docid ... 8083999422 - This one works more or less as it should with 100 constraint iterataions and 4 steps per frame. This setup earlier resultet in spastic behaviour of the top square.
http://video.google.com/videoplay?docid ... 7012395270 - This one is 100 iterations and 2 steps, notice the cubes tilting at the end.
http://video.google.com/videoplay?docid ... 9914953129 - This shows the real problem, 10 iterations and 4 steps.
http://video.google.com/videoplay?docid ... 7012395270 - This one is 100 iterations and 2 steps, notice the cubes tilting at the end.
http://video.google.com/videoplay?docid ... 9914953129 - This shows the real problem, 10 iterations and 4 steps.
-
- Posts: 56
- Joined: Tue Sep 11, 2007 2:30 pm
- Contact:
Re: Suitable values
Wow. That looks pretty weird. I've made the same "falling boxes" application myself, and I've always seen good results with whatever the default values are.
In my experience, whenever things are really messed up, I double-check that my time-step is not too small. If I have a simple application with no frame-rate limiter, the time-steps may approach zero, which can have some unpredictable effects.
If you suspect that this is your problem, try to put a sleep for a few milliseconds somewhere in your main loop.
In my experience, whenever things are really messed up, I double-check that my time-step is not too small. If I have a simple application with no frame-rate limiter, the time-steps may approach zero, which can have some unpredictable effects.
If you suspect that this is your problem, try to put a sleep for a few milliseconds somewhere in your main loop.
-
- Posts: 21
- Joined: Sun Jan 27, 2008 10:56 am
- Contact:
Re: Suitable values
Well, I've recoded the entire app (not because of this, but because I just made some wrong turns waaay back) and now it works... the problem was that I sat the inertia manually with (what i thought) suitable values... like 100 on a 100x100 cube with a mass of 10. Having done some inertia caluculations now I realise how silly it was and I'm feeling really ashamed of this thread all together
But thanks for your help.
But thanks for your help.
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: [Solved] Suitable values (jumpy and exploding simulation)
Heh. that's a common one. I was actually thinking that might be it.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 21
- Joined: Sun Jan 27, 2008 10:56 am
- Contact:
Re: [Solved] Suitable values (jumpy and exploding simulation)
Well its a valueable lesson learnedslembcke wrote:Heh. that's a common one. I was actually thinking that might be it.
Who is online
Users browsing this forum: No registered users and 14 guests