POV-Ray : Newsgroups : povray.off-topic : The Unintended consequence of "fixing" a physics timestep : Re: The Unintended consequence of "fixing" a physics timestep Server Time
2 Nov 2024 16:08:52 EDT (-0400)
  Re: The Unintended consequence of "fixing" a physics timestep  
From: scott
Date: 15 Apr 2008 03:42:22
Message: <48045c5e@news.povray.org>
> Fortunately, there's a simple solution for this.  While "fixing" your 
> timestep
> provides a valuable increase in the quality of your simulation, the 
> solution is
> to simply make a step using whatever dt you have.  That is,
>
> if (dt > ts*5)
>  step(dt)
> else
>  while (dt > ts)
>    step(ts)
>    dt -= ts
>
> The 5 above was chosen at random, and can be modified to suit individual
> simulations.

That's a bad idea, what happens when Invisible comes along with his 10 year 
old PC and your code starts doing time-steps of 10*ts or even 20*ts?  Who 
knows?

Far better to *always* do step(ts), you can absolutely guarantee that on 
every single machine the results will be the same then.  And if it takes 
Invisible's PC 10*ts to do a ts time-step, then so be it and just let the 
simulation run at 1/10th speed, it can't be improved.  It's a much better 
way to peform on slow PCs rather than having unknown things happen with huge 
time steps.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.