> Date:         Wed, 19 Feb 2003 03:26:03 -0700
> From: Joost Verschuren <[EMAIL PROTECTED]>
>
> Updating the position and orientation of the target object and viewplatform
> is done in the preRender() callback function. First the transform group of
> the target object is updated. Then the transformgroup of the viewplatform is
> calculated from the transformgroup of the target object.

This sounds OK so far.  You're updating both the view platform and target
object transform at the same time, so they should be in sync.

> Most of the time this will work but sometimes the view flickers. It looks
> like the viewplatform transform is one frame behind the target transform for
> a frame. The next frame the camera seems to target the object OK.

Odd result given that it seems you updated the transforms simultaneously.
Odder still that you only get the flicker on certain platforms.  It suggests a
race condition that favors one outcome or the other depending upon the timing
of concurrent threads.

It's difficult to suggest a solution without seeing the code.  Are the object
and view platform transforms really updated sequentially in the same thread as
you indicate?  Do you compute the object and view platform transforms from data
that you know is current, or are you perhaps relying on data derived from
internally maintained Java 3D state?

There are a few latency issues in the Java 3D 1.3 architecture that could
affect what you're doing:

1) Updates to geometry and texture data have a 1-frame latency.
2) Updates to transforms and scene graph structure have a 2-frame latency.
3) Methods such as getImagePlateToVworld() in Canvas3D query the internal
   representation of the Java 3D scene graph, which has the 2-frame latency
   previously mentioned, so you can't use those methods directly to
   synchronize view dependent scene graph updates.

We have a workaround for issue 1) that involves a behavior post mechanism to
delay geometry and texture updates by 1 frame, and I've developed a utility,
ViewInfo, that works around issues 2) and 3).  Let me know if you'd find those
of any interest.  ViewInfo should be available in Java 3D 1.3.1 beta2 but I can
get you an early copy.  In the mean time, a test case would help us determine
if your problem is a bug in Java 3D.

Thanks -- Mark Hood

===========================================================================
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".

Reply via email to