Skip to main content

Need a way to add and remove objects smoothly

2 replies [Last post]
Rouben
Offline
Joined: 2006-02-17
Points: 0

Hi Guys,

I am currently adding and removing objects to a live scene by using a BranchGrup as follows:

I remove the BranchGroup from the scene, clear its contents, add new shapes to it, then add the BranchGrup back to the live scene. Each time I add a BranchGrup to the scene with a new set of shapes can be thought of as a movie frame....i have a scroller at the bottom that populates the BranchGroup with the shapes belonging to the given frame. The user can also hit play where the scroller moves through each frame...so the user sees the data like a movie. The problem however is that between each frame, the view clears, then objects appear, then clears, then objects appear....as i add and remove the BranchGroup.

Does anyone know of a way i can add and remove objects without getting this blinking effect of nothing, then something, then nothing, and so on...

thanks a billion in advance,
-Rouben

Reply viewing options

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

Take a look at using a behavior. Normally you can remove and add everything
in one behavior and all of the changes should appear at the same time. Note
that there are some frame delays depending on what you are updating.

Search the lists for synchronization issues. You can also look at using a
switch group with all of the frames of the animation preloaded.

-mike

-----Original Message-----
From: java3d-interest@javadesktop.org
[mailto:java3d-interest@javadesktop.org]
Sent: Saturday, October 30, 2004 2:44 PM
To: interest@java3d.dev.java.net
Subject: [JAVA3D-INTEREST] Need a way to add and remove objects smoothly

Hi Guys,

I am currently adding and removing objects to a live scene by using a
BranchGrup as follows:

I remove the BranchGroup from the scene, clear its contents, add new shapes
to it, then add the BranchGrup back to the live scene. Each time I add a
BranchGrup to the scene with a new set of shapes can be thought of as a
movie frame....i have a scroller at the bottom that populates the
BranchGroup with the shapes belonging to the given frame. The user can also
hit play where the scroller moves through each frame...so the user sees the
data like a movie. The problem however is that between each frame, the view
clears, then objects appear, then clears, then objects appear....as i add
and remove the BranchGroup.

Does anyone know of a way i can add and remove objects without getting this
blinking effect of nothing, then something, then nothing, and so on...

thanks a billion in advance,
-Rouben
---
[Message sent by forum member 'Rouben' (Rouben Meschian)]

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

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

Rouben
Offline
Joined: 2006-02-17
Points: 0

Thanks Mike,

I think you are correct in that my problem is that of synchronization.

-rouben