Slappo Svensson wrote:

> So basically there's no way of telling whether or not
> a scene will get rendered just as you're making
> changes to it?

err... ahhhhh... yes and no.... If you are making modifications in a
separate thread to the threads driven by Java3D, then yes, there is no
guarantees. You have partially answered your own question in the next
secion, so I'll move along to that:

> How is this usually done? Are behaviors
> run by the rendering thread or is there a way to
> specify the frame rate you'd prefer and have the code
> that makes changes to it wake up at the end of a
> frame?

Yes and yes. J3D has a behaviour system that is the prefered way of
getting changes into the scene graph. Those behaviours can be
"activated" in a number of ways. Take a look at the WakeUp*,  *Condition
and *Criteria classes in the Javadoc. What you are interested in might
be something like WakeUpOnElapsedFrame(). This is a behaviour that gets
woken every X frames (if you specify zero then it gets called every
frame). During the time that this gets called you can safely assume all
the changes get made in time for the next frame render cycle. If you are
taking too long here, it will slow the render cycle down.

If all you are doing is modifying geometry, then ther is another option
for you. Have a look at the GeometryUpdater interface. Effectively, this
is a callback mechanism. You tell J3D that you want to update something
and then it calls you back when everything is fine. This is much smaller
than a behaviour, but also requires more work on your part because there
is less guarantee that all those callbacks coming from the j3d internals
will actually be for the same frame.

--
Justin Couch                         http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler              http://www.yumetech.com/
Author, Java 3D FAQ Maintainer                  http://www.j3d.org/
-------------------------------------------------------------------
"Humanism is dead. Animals think, feel; so do machines now.
Neither man nor woman is the measure of all things. Every organism
processes data according to its domain, its environment; you, with
all your brains, would be useless in a mouse's universe..."
                                               - Greg Bear, Slant
-------------------------------------------------------------------

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