Thanks for the response.   I have some questions:
 
For (1) below, you mention a way to control the transparency of each individual triangle making up the geometry object.  I think the problem is not the transparency value of the object/individual triangles but the order in which they are rendered which is the problem.  If I have a torus with a sphere in the middle hole of the torus and I look at it edge-on, then the torus is *both* in front of and behind the sphere.  How do you define the torus individual triangles (what's the branchgroup look like) so those triangles that are behind the sphere get rendered before the sphere and those in front get rendered after the sphere, yet they are all part of the "torus" object?
 
For (2), same question, How do you setup the tours object.  Sound like you take all the vertices of the torus and determine (by homeground code) which are behind the sphere (for this particular orientation) and divide them into 2 groups, those in front of the sphere and those behind.  Then have an OrderedGroup with 3 Shape3Ds, one for that part of the torus in front, one for the sphere, one for that part of the torus behind.  Seems like it would be *very* computational intensive because every time I move my viewplatform around I will have to recalculate the division of the torus into 2 parts.  Am I missing something here?
 
I don't know enough to understand (3).  How do you control rendering passes?  Is this the same as the OrderedGroup suggestion in (2)?
 
If I took all the Triangular Arrays for each object and made one big merged TriangularArray....  but then how to control the Texture for each triangle in the array? What's the geometry updater you mentioned?  This might work.....  What do you think?
 
Thanks for the suggestions.
 
Bob Gray
 
-----Original Message-----
From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]]On Behalf Of Yazel, David J.
Sent: Tuesday, November 13, 2001 9:46 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Transparency

Heh this is not a trivial problem.  Its hard to solve without a more specific specification of what you want to see.  Do you want the intersection highlighted or just visible?  If you have two objects that intersect (assuming both are usually opaque) do you want one to become translucent so you can see the opaque piece of one of the objects?  And how do you pick which one is made to see through?  Now expand the problem to multiple objects and it becomes more complicated.  Then there are the other cases like one object actually containing another object.
 
In any event, having lots of shapes, one per triangle is not the way to do.  I think there are several categories of solutions:
 
1.  Use dynamic geometry (geometry updator) and adjust the colors and alpha of the vertices.  This way you can completely control the transparency and color of all the triangles. 
 
2. Render everything in multiple passes using an ordered group.  Make everything at least partially transparent and use an additive blending model so that intersections are blended at higher brightness.
 
3. Render everything partially transparent, then re-render the sub-objects which represent the portion of the models whiich intersect.  In the second pass you could render the sub-objects opaque.
 
Good luck, it is an interesting problem.
 
Dave Yazel
 
 -----Original Message-----
From: RWGRAY [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 9:10 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Transparency

To make transparency work correctly when objects intersect each other (so you can see the intersection part), how do you setup the object?
 
1) Do you have 1 Group node with **many** Shape3D's attached to the Group node, one Shape3D for each little triangle of the objects (many hundreds Shape3Ds)?
 
2) Or do you have 1 Group node with 1 Shape3D node which has *many* TriangularArray, one for each little triangle (many hundreds TriangularArray)?
 
3) Or is there some other way to define an object such that each triangle is considered "independent" and will result in correct transparency rendering when intersecting other such objects (with zbuffering set to order the rendering of each little triangle)?  
 
For example, I have a sphere through which I intersect a cylinder and a torus.  All objects are partially in and partially out of the other objects.  Setting the transparency, I want to see the intersecting parts.  What is the best way to define the geometry that will make this happen?
 
What is the performance hit going to be when having hundreds of Shape3Ds or TriangularArrays or whatever *per* geometric object?!
 
Bob Gray
 
 

Reply via email to