![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Lutz-Peter Hooge" <lpv### [at] gmx de> wrote in message
news:3d9b28f1$1@news.povray.org...
> In article <3d9b157e@news.povray.org>, orp### [at] btinternet com says...
>
> > #declare TimeStep = clock_delta * TotalTime; // = seconds since prev
frame??
>
> What about Timestep=1/FPS? ;-)
>
> Lutz-Peter
OK, why didn't _I_ think of that!!! :-S
Andrew.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> The problem is that, while the
> constant is related to the framerate, it's not *linearly* related.
Grrr... what a pain in the head!
Will have to sift some more algebra offline...
Andrew.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Just a thought... Would this work like compound interest? I.e., if an
investment earns 30% per year, you can work out how much it earns in, say, 1
month, such that over 12 months the compounded figure still adds up to 30%
of the original. So a) is this analogy correct, and b) does anyone out there
know the compound interest formula? :-)
Andrew.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Just a thought... Would this work like compound interest? I.e., if an
> investment earns 30% per year, you can work out how much it earns in, say,
1
> month, such that over 12 months the compounded figure still adds up to 30%
> of the original. So a) is this analogy correct, and b) does anyone out
there
> know the compound interest formula? :-)
Yes, it's probably correct, since it's exponential, as is the simplified air
resistance model we've presented. But no I don't know the formula. =)
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mmm... ok, well let's say I want my particle to loose 30% of it's velocity
every second (that's probably too much, but just for example). So, if a time
step is 1 second long, I want the damping to be 30%. If it's 2 seconds, I
want it to be 30% squared... So, I'm guessing something like 30 ^ (time step
in seconds). Seem reasonable? Once I know how much velocity the particle
should loose during this step, I can just use V = V * (1 - k) to remove it.
Opinions?
Andrew.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Andrew Coppin wrote:
> Mmm... ok, well let's say I want my particle to loose 30% of it's velocity
> every second (that's probably too much, but just for example). So, if a
> time step is 1 second long, I want the damping to be 30%. If it's 2
> seconds, I want it to be 30% squared... So, I'm guessing something like 30
> ^ (time step in seconds). Seem reasonable? Once I know how much velocity
> the particle should loose during this step, I can just use V = V * (1 - k)
> to remove it.
This is correct but you have a problem when you want to change the time
steps.
Let's see..
The decrease in velocity over time is to be constant. Therefore:
dv/dt = -k
for some positive k. This differential euqation has the solution:
v(t) = c0 * exp(-kt),
where c0 = v(0).
Now if you want to calculate v(T + deltaT) you need:
v(T + deltaT) = c0 * exp(-k*T -k*deltaT) = c0 * exp(-k*T) * exp(-k*deltaT)
= v(T) * exp(-k*deltaT)
This allows you to calcuate the sequence of v for any stepsize deltaT.
But what is k? Assume you want to have v(t + 1) = p*v(t), this means v
loses (1-p) of its velocity in 1 second. How to chose k?
v(t + 1) = c0*exp(-k*t -k) = c0*exp(-k*t) * exp(-k) = v(t)*exp(-k)
Therefore:
v(t)*exp(-k) = p*v(t) => p = exp(-k) => k = -ln(p)
E.g. if you want p = 0.3 (loses 70%/second) then
k = -ln(0.3) = 1.203...
Just a bit math ;)
- Micha
--
objects.povworld.org - The POV-Ray Objects Collection
book.povworld.org - The POV-Ray Book Project
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> E.g. if you want p = 0.3 (loses 70%/second) then
>
> k = -ln(0.3) = 1.203...
>
> Just a bit math ;)
>
> - Micha
I seldom cease to be humbled by the skill of the folks on this news
Smooth move!
Andrew.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Andrew Coppin wrote:
>
> I seldom cease to be humbled by the skill of the folks on this news
>
I just see right now that my result is a bit more complicated than it needs
to be.. you can get rid of the exp/ln if you put k = -ln(p) back into the
equation:
v(T + deltaT) = v(T) * exp(-k*deltaT) = v(T) * exp(ln(p)*deltaT)
= v(T) * p^deltaT
That means, e.g. with p = 0.3 and deltaT = 0.01 you get
v(T+0.01) = v(T) * 0.3^0.01 = v(T) * 0.98803
But the calculation serves as justification for this formula (You wouldn't
want use something you didn't prove ;) )
- Micha
BTW: You should really get into differential equations... it's one of the
most interesting things in math.
--
objects.povworld.org - The POV-Ray Objects Collection
book.povworld.org - The POV-Ray Book Project
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> BTW: You should really get into differential equations... it's one of the
> most interesting things in math.
And applicable =)
Although I'm not sure what Andrew's math level or even age is. Calculus may
be in the future or the distant, forgotten past for him.
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Slime" <slm### [at] slimeland com> wrote in message
news:3d9dd490$1@news.povray.org...
> > BTW: You should really get into differential equations... it's one of
the
> > most interesting things in math.
Naah - knot theory is *much* more interesting ;-D
> And applicable =)
OK, point taken...
> Although I'm not sure what Andrew's math level or even age is. Calculus
may
> be in the future or the distant, forgotten past for him.
For anyone who cares... I'm 22, and I've never had a "propper" algebra
lesson in my life; the only thing I learned at school (err... or rather, the
only thing I was *taught* at school ;-) as how to add and subtract, etc. As
far as "real maths" goes, what can I say? Libraries are beautiful things 8-D
I know a little differential calculus... I never really did get my head
round the notation used for integral calculus... I know roughly what a
derrivative is, but I have no idea what a "differential equation" is.
(Although I'm always hearing about them!) I didn't really read Micha's post
other than skimming through it and observing that the final result "seems"
to make good sense. I was going to read through again offline later - but I
ain't got round to it yet ;-)
Andrew.
PS. I _still_ don't know my times tables... THIS IS WHY COMPUTERS WERE
INVENTED 8^)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |