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

This is a frequently encountered limitation to J3D 1.1.  Making a single scene
graph change causes four frames to be draw.  The problem is not as bad as it
might seem: if you are making a series of changes (i.e. an animation) J3D will
draw only one frame per scene graph change.  Once you stop making changes J3D
will draw a couple extra frames.  So for a single scene graph change you'll get
4 frames, but if you run an animation with 100 frames of changes you should see
103 frames output.

Why does it behave this way?  The answer is a bit complicated, but you can think
of the J3D 1.1. implementation having a multi-stage rendering "pipeline".  A
scene graph change moves through the stages of the pipeline, with a frame being
drawn each time the data moves to the next stage of the pipeline.  A single
change renders frames until the pipeline has "drained".  Multiple changes enter
the pipeline one frame at a time, several frames of data are in the pipeline at
once.  The effect is that a single change causes several frames to be drawn, but
multiple changes show up as one change per frame.

J3D 1.2 will not have this architecture.  A single scene graph change should
cause only one frame to render in J3D 1.2.

Doug Gehringer
Sun Microsystems

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