I'm trying to write a Java3D program where, in a separate thread from
the rendering loop, I directly make a change to a live transformgroup in
order
to move/turn the viewplatform. I then need to capture as an image a
rendered frame which
has been rendered AFTER the move or turn has been accomplished. The
frame image is being
captured in my overridden Canvas3D.postSwap() method.
The problem I'm facing is being able to figure out which frame to
capture in order to
guarantee that my frame was rendered after the transformgroup change
takes effect.
Currently, I set a flag (viewChanged) after the call to set the
transformGroup's
transform has returned (all this in my own application's separate
thread.)
Now, in preRender(), if the viewChanged flag is true (i.e. supposedly
the transformgroup
has been changed before this render is going to take place), I set
another flag
that tells my postSwap() to capture the frame. Flags are reset after
capturing.
However, using this method, I am finding that almost always, if not
always, the
frame I get as an image is a frame that reflects the state of the model
just BEFORE
to transformgroup change takes effect.
Does anyone know why this is? It seems to me that my
transformGroup.setTransform(Transform3D) call should not return until
after it has
effectively changed the scenegraph, and that a render-sequence whose
preRender()
is called AFTER setTransform() returned (regardless of thread) should
reflect the
changed scenegraph.
Does anyone know a better way I could accomplish this?
Eric
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/