Some feedback, I ended up using suggestion no. 2. It seems to work pretty
well, and considering the amount of geometry I have, the performance I think
is pretty good, it takes about a couple seconds to render every time I
change the geometry. Thanks again! Appreciate your help. Now I'm looking at
ways to improve my memory consumption.
Ibrahim

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ibrahim Z Mohammad
Graduate Research Assistant
Dept. of Civil and Environmental Engineering
University of Illinois at Urbana-Champaign
205 N Mathews St.
3111 Newmark Lab
Urbana, IL 61801
(217) 766-5516
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



-----Original Message-----
From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]
On Behalf Of Florin Herinean
Sent: Friday, February 20, 2004 8:46 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Shape3D problem

That's tricky, so you need to use tricks ;)
The problem is that the renderer runs in another thread that the one in
which you're modifying the shape3d.
 
1. first option is to stop the renderer before you remove the geometries and
start it again after you've finished adding. pros: very easy to implement.
cons: if the addition is time consuming, you may have rendering artifacts on
the screen - the renderer is stopped !
 
2. have a special branch group for your shape 3d. Then when you want to
modify it, you detach the branch from the scenegraph, do your changes and
attach it again. cons: detaching / attaching may be time consuming.
 
3. use the flip technique: you have a switch with two components. At a given
time, only one of them is displayed. You always modify the invisible one,
then flip the switch. cons: a little more code to write, but that one gives
the best visual experience.
 
4. use immediate mode. cons: for profis ;)
 
Cheers,
 
Florin
-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED] Behalf Of Ibrahim Z Mohammad
Sent: Freitag, 20. Februar 2004 15:24
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Shape3D problem
Hi,
I have a question about rendering of geometry in a Shape3D. In my program, I
need at certain times to change the geometry component of my Shape3D to
display certain different geometry. I do this by a call to 
myShape3D.removeAllGeometries() and then add all the geometries I need by a
loop around myShape3D.addGeometry(someGeometry[i]) The problem is, since I
have a very large number of geometries (around 30,000, I’m doing
visualization for a granular soil particle simulation where each geometry is
a soil particle), the geometries don’t appear at the same time, rather the
renderer starts by rendering the geometries one by one, from the first added
one to the last. I was wondering if there is a way by which I could make the
shape3D not display the geometries until all of them have been added to it.
When I first load the program, the geometries all appear at the same time
even though I use the same procedure to add them, but the Shape3D hasn’t
been added to the scenegraph at that time. But when I change the geometries
after adding the Shape3D to the scenegraph, I see this problem. Any
suggestions?
Thanks!
Ibrahim
===========================================================================
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