From: "David" <[EMAIL PROTECTED]>
Sent: Sunday, March 04, 2001 12:25 PM
> We do our view changes and animations per frame, using elapsed time to
> calculate rotations in degrees/sec and movements in meters/sec. That way
> our scene stays consistant even if frame rates drop. But I had long felt
> things were not as smooth as they could be and never looked into it until
> now. Turns out that we are getting elapsed time from one frame to another
> of zero very often, causing our scene to be rendered exactly the same as
> several frames in a row, then a draw a new frame then a few copies, etc.
It
> looks like at around 50 fps, I am getting 3 dups for every 1 real frame
> recalc. Course everything still looks right, but I am losing 3 steps of
> smoothness.
I couldn't take the dead time when Java was off doing GC or Windows was
resizing or moving windows, while the Interpolators ran ahead on the system
clock. I had to write my own simulation clock and interpolators to
eliminate the jumps. The jumps are gone, but of course the sim clock slips
with respect to the wall clock whenever those processes run. My sim clock
ticks on WakeupOnElapsedTime(delta_t); I calculate the new system state, and
draw a frame. Now if delta_t is much diffferent from the system clock
heartbeat, then the sim clock slips every frame by an amount equal to some
integral of the system heartbeat period minus delta_t. To minimize this
slip rate, I measure the system heartbeat period at startup with a sequence
of wait() routines and set delta_t slightly greater than a multiple of the
heartbeat period. I think that the way it works is that the Wakeup comes
true a few ms before it gets checked.
I measure WinNT's and W2000k's heartbeat periods at about 15.6 ms, so a
delta_t of 45ms (~22fps) is usable for the toy simulations I'm doing now.
Data given by Sun here on this list while I was asking about this las summer
reported the minimum step at 20ms and increments of 10ms after that for
Solaris. I have never made sense of the measurements I've taken on Win9x,
and my simulations don't run very well there.
Getting a finer resolution to the wait() would make life a lot easier, not
to say more likely to "run anywhere."
There's some discussion and code fragments embedded with other stuff at
http://www.brockeng.com/VMech/IK/IKSG.PDF
Some day, I'm going to GNU all of those classes. If there's any interest,
I'll hurry.
Fred Klingener
Brock Engineering
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".