Skip to main content

[JAVA3D-INTEREST] Scene updates

2 replies [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Mike Pilone

Hello,

One option is to do all of your updates in a behavior, which garuntees that
the updates are applied in the next frame. There are some gotcha's to this,
such as Appearance updates taking one frame and geometry updates taking 2.

I would suggest using a behavior to force 2 frame updates before any
capture. This can be done with a WakeOnElapsedFrames condition.

-mike

-----Original Message-----
From: java3d-interest@javadesktop.org
[mailto:java3d-interest@javadesktop.org]
Sent: Sunday, August 29, 2004 6:25 AM
To: interest@java3d.dev.java.net
Subject: [JAVA3D-INTEREST] Scene updates

In my code I'm applying modifications to the Appearance and/or the
transforms of various objects in a scene through a Swing gui.
The scene is attached to an offscreen Canvas which I use to take snapshots
of the scene.

Probably due to the asynchronous design of Java3D (or maybe it's my
mistake), quite often I do not get my snapshots up-to-date with the params I
set with the gui.

Is there a way to wait for the completion of the scene updates before taking
a snapshot ?

Suggestions welcome.
---
[Message sent by forum member 'MikOfClassX' (MikOfClassX)]

http://www.javadesktop.org/forums/thread.jspa?messageID=25365&#25365

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

mikofclassx
Offline
Joined: 2003-07-02
Points: 0

Thanks for the hint Mike.

Anyway I would say that all my scene synch troubles vanished automagically by adding the following line to the scenegraph construction:

objRoot.addChild(new Box(.0000001));

I also set the priority of java3d to 1:

universe.setJ3DThreadPriority(1);

Now everything works very well. Do not ask me how it can be possible. It is most likely an issue of Java3D when it renders offscreen.