This has come up a few times.  This is an artifact of the current implemetation
of Java 3D.  It is true that for a single scene graph change on an otherwise
static scene, Java 3D will render multiple times.  The number of times depends
on the type of change.  It is not however, rendering the scene multiple times
for each change.  Let's use HelloUniverse as an example.  After each frame
elapses, the RotationInterpolator wakes up an applies a new rotation to the
cube.  The renderer will only render the cube in that position once.  The next
frame will be rendered with the next cube position.  The extra renders happen
when a steady state system stops animating.  If we were to stop the cube from
animating, the renderer would end up rendering the last position of the cube
multiple times before it stops rendering.

I hope this explains it a little bit.  In the 1.2 implementation of Java 3D,
this artifact is gone.

Doug Twilleager
Java 3D Team

> MIME-Version: 1.0
> Subject: [JAVA3D] postSwap() Question and performance
> To: [EMAIL PROTECTED]
>
> I display a scene in which nothing happens unless you type a key.  When you
> type a key once, a behavior rotates the scene once by a fixed angle amount.
>
> I defined MyCanvas3D by extending Canvas3D so that I could get access to the
> postSwap() method.
>
> By putting a counter in my postSwap() method, I find that for every scene
> change (one key type) postSwap is getting called *4* times.
>
> The Java 3D API doc says:
>
> "This routine is called by the Java 3D rendering loop after completing all
> rendering to the canvas, and all other canvases associated with this view,
> for this frame following the buffer swap."
>
> Can someone tell me why postSwap is getting called 4 times?  Is this an
> indication of a performance problem?  Is there more going on than there
> really needs to be?  Is there something I can do to have postSwap() called
> only once (and maybe make my rotation of the scene a little smoother?) Is my
> scene being rendered/updated 4 times for every scene change?
>
> Bob Gray
>
> ===========================================================================
> 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".

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