|
Another
idea is to look at your Z-buffer ratio.
If you are messing around with the front and back clip distances, you
can get some weird artifacts. I have
seen a problem similar to the one described, objects were popping in front of
closer objects at random rotation angles.
This problem was due to the Z buffer ratio being way too big, therefore
drastically cutting down on the Z buffer accuracy. Sometimes people think to push the back clip plane out to
encompass large objects, but leave the front plane alone. Since the front plane defaults to 0.1,
it does not take long for the ratio to get out of wack. If you have a graphics card with a 16
bit Z buffer, the problem gets worse in a hurry. Don’t know
if this is your problem, but you might give it a look. Jim -----Original
Message----- I actually
had the opportunity at Siggraph to speak to Henry Sowizral at Sun who is
involved with the Java3D development - you may have seen him also at the
Java3D BOF at the JavaOne conference. He was looking at a demo that I had
made which exhibited precisely the same effect, and he mentioned that that was
a known bug which would be fixed in a subsequent release. So how do you
work around this transparency problem? Hmmm.... Naively speaking I
guess the defect is simply that translucent objects can't rely on the
zbuffer. I could be wrong here. But anyway if this is true
then correct translucency requires objects being printed in a sorted
order. Probably (again making another assumption) Java3D does make some
efforts to paint objects in sorted order but of course this can fail since you
can't guarantee sorted order for objects which interpenetrate in the viewing
camera forward viewing vector. Of course this approach only
works for simple convex or 'shomarkerable' objects (objects which always
render correctly if rendered with a known polygon ordering). An object
level BSP here would help you do this efficiently or you could sort them
by hand. Somehow you have to guarantee the right manual
sorting. Perhaps if you know how the scenegraph is traced you can
arrange your geometries to always successfully render in the right order - but
you have to reorder your scenegraph every frame. Alternatively you can
just print them by hand - this is probably doable in direct mode. Even in
this case however you can get degenerate cases that resist sorting. For objects
which are more complex such as overlapping forks or something like that you
need to decompose your objects down to the polygon level... and at that point
you need to start using polygon BSP style solutions to guarantee correctness. Anyway I
could be entirely wrong - for example why is hardware also sometimes subject to
this defect? It may not be a sorting problem at all but just some other
artifact. In that case I have no idea what layer is responsible for this
kind of issue - if its the fault of the higher levels such as Java3D or if it
is the fault of the low level rasterizer such as OpenGL. I would tend
towards the latter in fact and if this is true then there may be some
information in one of the numerous OpenGL books or websites on this topic. - Anselm
Hook -----Original Message----- Ok, in
response to the message below. Thank you for responding to my
question! Your response was very helpful actually. It does turn out
that my problem was due to (a bug?) with Transparency and overlapping
objects. The problem occurs even if the Appearance of your objects which
are "overlapping" has a TransparencyAttribute set (even if the
transparency on all objects is 0.0f ). This kinda sux though, since I was
planning on having one of the objects in my group being semi-transparent.
Anyone have any suggestions on how to work around this problem? -----
Original Message -----
Sent: Friday, October 22,
1999 6:18 PM Subject: Re:
[JAVA3D] Problem with grouping several objects Are any of
your objects partially transparent? I heard there was a defect with
how translucent objects were drawn when overlapping each other. This bug
you're seeing might not have anything to do with the fact that your
Shape3D's happen to be in the same group. -
Anselm Hook -----Original Message----- Hi All, I'm
wondering if anyone out there has some insight on this. I created a class
which defines several different custom Shape3D objects. All of these
objects in the class are add to a single 'Group' object, and the getShape() of
this class returns the Group object. This is so that I can add the single
large group of objects as "one" Shape to the scene graph and
transformations on that group will affect the entire object. My
problem is that for some reason, when I create one of these objects and add it
to my scene, some of the "individual" Shape3D objects from the
original class seem to "overlap" each other. The group as a whole
still transforms as one object, but the individual pieces that make up the
group this problem. For example, a large cube-like object seems to
cover a plane-like object, even though the plane is closer to the viewer
(z-buffer). Does anyone know why this might happen? Any help would
be appreciated. Steve
Grenier |
- Re: [JAVA3D] Problem with grouping several objects (transparen... Anselm Hook
- Jim Miller
