Re: Phix / pGui Rosetta example : animate_pendulum2.exw
- Posted by petelomax Jul 05, 2018
- 1371 views
while window resizing, the pendulum position update is called too often and the mad behaviour ensues.
That's true, I guess, but I was never that concerned with a bit of speed-up during the resize itself. Still, I'll take it, thanks.
It's possible to get the pendulum hurtling round the pivot point in one direction.
Yeah, that's what I meant by the madness, that persists after the resizing has stopped.
My thought so far is that it's caused by the pendulum velocity being unrealistic for the new length but I haven't tried to fix it yet.
Just before I opened your post, from the subject line, I stabbed a guess that you were resetting things. Anyway, I tried that:
integer waslen = 0 -- (file-level) ... if len!=waslen then waslen = len alpha = PI/2 omega = 0 end if
That certainly stopped the madness, but I don't really like that effect much though.
If it could instead be done as omega=some_func(alpha,len), and alpha left alone, perhaps?
Another thing that struck me is that alpha, omega, and epsilon are simply awful names.
They probably made more sense in some lecture or book with a nice diagram we don't have.
I guess alpha is an angle, epsilon is [eek!] a delta, and is omega a velocity?
How important do you think this issue is?
I honestly cannot think of anything less important
Pete