If I understand what you're trying to do, this is an FAQ Question:

from: http://tintoy.ncsa.uiuc.edu/~srp/java3d/prog.html#zbuffer

3.I drew several things on the screen, but when I display the scene, it looks
like the objects in the back are actually in front. How do I stop that from
happening?


       There are a couple of ways to do this, depending on what effect you are
trying to achieve.

       The easiest way is to turn on Z-buffering. You can do this by setting
the RenderingAttributes object within the Appearance Node in a Shape3D object.

                       Appearance app = new Appearance();
                       //
                       // set Appearance attributes as you'd like
                       //
                       RenderingAttributes ra = new RenderingAttributes();
                       ra.setDepthBufferEnable(true);
                       app.setRenderingAttributes(ra);

Bob Gray wrote:

> I just ran into a *major* problem with my project and I am hoping someone
> can give me a suggestion or two...
>
> I am writing a Java 3D program to display polyhedra.
>
> I display 2 polyhedra which intersect each other.
> Part of polyhedron #1 is suppose to be behind (or inside) polyhedron #2.
> I thought that those parts of polyhedron #1 which are behind on inside
> polyhedron #2 would not get rendered.
>
> But it renders *all* of polyhedron #1. Even the parts that are "inside"
> polyhedron #2!
>
> How do you setup the scene graph (or culling properties??) so that any part
> of the triangle that is behind other triangles (defined by distance to
> viewing platform and *not* by the order the objects are attached to the
> scene) do not get drawn?
>
> It seems to be drawing *all* of the polyhedra in the order I attach these 2
> objects and ignoring whether or not a face is located inside the other
> polyhedron.
>
> This has put an end to my project unless someone has a suggestion.
>
> Bob Gray
>
> ===========================================================================
> 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".

--
Steve Pietrowicz - [EMAIL PROTECTED]    Project Manager - NCSA Java 3D Group

NCSA Portfolio 1.3 beta 2:  http://havefun.ncsa.uiuc.edu/Java3D/portfolio/
   New Loaders, turn your Canvas3D into a JPEG, new InputDevices and more!
   Freely available for non-commercial use!

You Build It VR:     http://havefun.ncsa.uiuc.edu/Java3D/YouBuildItVR/
   Build your own multi-user virtual worlds with no programming experience!
The Java3D FAQ:      http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html
Java News Network:   http://tintoy.ncsa.uiuc.edu/~srp/java/javanews.html

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