I can confirm this approach works. I implemented it to display a surface graph
with both colors and wire-frame.
To be more specific about the Z value, you'd need to set the polygon offset for
the wire-frame _less_ than that for the filled polygons. For the wire-frame's
appearance:
PolygonAttributes attrPolygon = new PolygonAttributes();
attrPolygon.setPolygonMode( PolygonAttributes.POLYGON_LINE );
attrPolygon.setPolygonOffset( -1 ); // Nudge toward viewer.
Also, I agree with Mark. We shouldn't have to have two separate Shape3Ds to
produce a single visual object that's both filled and wire-framed. Memory
requirements might be drastically reduced if a single Shape3D could be both
filled and wire-framed.
However, wouldn't a little more be required than just changing the polygon mode
to a bitwise-OR? How would the color of the wire-frame be specified
independently of the color of the fill? (If they had the same coloring, there'd
be no point -- or rather, no lines. :P )
-----Original Message-----
From: Mark Ferneau <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, September 29, 2000 11:05 AM
Subject: Re: [JAVA3D] FW: [JAVA3D] border on polygons
>Daniel,
>
>This capability is already there, though it's a bit obfuscated now and the
>J3D team could help us out here--assuming that this workaround will work.
>
>The PolygonAttributes class allows you to define the rasterization of a
>polygon, in other words, how the polygon is represented on the screen. The
>options are:
>
>POLYGON_POINT - the polygon is rendered as points drawn at the vertices.
>POLYGON_LINE - the polygon is rendered as lines drawn between consecutive
>vertices.
>POLYGON_FILL - the polygon is rendered by filling the interior between the
>vertices. The default mode.
>
>You are essentially looking for a combination of POLYGON_FILL and
>POLYGON_LINE. This *is* something that is supported directly by OpenGL but
>for some reason J3D isn't supporting it.
>
>I think a workaround (SUN J3D TEAM PLEASE VERIFY) would be to
>
>1) Make a complete copy of your Shape3D and then
> - Set the Appearance of the original with PolygonAttributes to
>fill the polygons (default)
> - Set the Appearance of the copy with PolygonAttributes to draw
>the outlines.
>2) Set up your SceneGraph such that you can use a SharedGroup and an
>alternate appearance for the second instance of the Shape3D.
>
>Important note: You will likely run into issues with Z buffer tests when
>this occurs as the lines and the polygons will more than likely end up with
>the same Z value. Therefore you should be able to adjust your Z test and
>order the rendering of your Shape3D objects as appropriate.
>
>The bottom line is that J3D could change the polygonMode member of
>PolygonAttributes to hold multiple modes, not just a single one. Then
>everything would work with a single change of the PolygonAttributes.
>
>How about it Sun?
>
>At 11:06 AM 9/29/2000 -0400, you wrote:
>>Sorry. My original goal is to put borders around each polygon in a Shape3D.
>
>
>
>Mark Ferneau 240-462-6262 (cell)
>Director of Adv. Technology 801-437-4608 (efax)
>Xtivia Technologies, Inc. 732-469-5954 x629 (NJ office)
>[EMAIL PROTECTED] 301-279-5703 (home office)
>http://www.xtivia.com/ [EMAIL PROTECTED] (wireless email)
>
>===========================================================================
>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".