> I want to display a wireframe object using PolygonAttributes.POLYGON_LINE.
> The problem is that I don't know how to remove the hidden lines.
An example of this is attached. You'll want to do the same thing as the
example, except you'll want to make the filled polygons have the background
color.
Specifically, you'll want to draw the object using two Shape3Ds with the same
Geometry (the example uses two copies of the geometry for convenience). The
first Shape3D will have an appearance with POLYGON_FILL and the background
color. The second has an appearance with POLYGON_LINE and the line attributes
you want. The combination removes the hidden lines.
Polygon offset overcomes limitations in the depth buffering algorithm for lines
and polygons. Without it the lines get rendered with lots of random gaps. Play
with the dynamic and static offset values to get the best results for your
graphics card.
Doug Gehringer
Sun Microsystems
PolygonOffset.java