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:10:22 EDT (-0400)
  Re: The Unintended consequence of "fixing" a physics timestep  
From: John VanSickle
Date: 14 Apr 2008 21:38:16
Message: <48040708$1@news.povray.org>
Chambers wrote:
> So, playing with particles recently, I noticed a small* problem.
> 
> "Fixing" your timestep, such that it is always processed in increments of some
> arbitrary value, greatly increases the quality of your simulation.  When dt
> seconds have passed, and your timestep is the arbitrary value ts, then
> 
> while (dt > ts)
>   step(ts)
>   dt -= ts
> 
> The fun part comes up when the time required to do a simulation step is greater
> than the time stepped (ts).

Only if you want real-time performance.  For us animators, that's not an 
issue.

If you have access to system timekeeping, simply measure the start and 
end times at the beginning and end of each loop, and advance the time 
clock by that value at the end of each pass.

Regards,
John


Post a reply to this message

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