> Date: Tue, 10 Jul 2001 11:30:37 -0700 (PDT)
> From: Kelvin Chung <[EMAIL PROTECTED]>
> Subject: RE: [JAVA3D] Problem with IndexedGeometryArray
>
> Hi Jyothi,
>
> >X-Unix-From: [EMAIL PROTECTED] Mon Jul 9 23:42:32 2001
> >From: Jyothi Mohan <[EMAIL PROTECTED]>
> >To: "'Kelvin Chung'" <[EMAIL PROTECTED]>
> >Subject: RE: [JAVA3D] Problem with IndexedGeometryArray
> >Date: Tue, 10 Jul 2001 16:39:50 +1000
> >
> >Hi Kelvin,
> > Iam using OpenGL version of Java3d. I have data in a data file which
> >contains all the vertices (not duplicated) and the faces with their vertices
> >defined using indices. I use the
> >IndexedGeometryArray to draw a solid box with flaps open
> >
> >GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
> >gi.setCoordinateIndices(indices);
> >gi.setColorIndices(indices);
> >gi.setCoordinates(indexedP3fVerts);
> >gi.setColors(indexedC3fClrs);
> >gi.setContourCounts(contourCounts);
> >gi.setStripCounts(boxSideVertexCounts);
> >IndexedGeometryArray box = gi.getIndexedGeometryArray();
> >box.setCapability(Geometry.ALLOW_INTERSECT);
> >setGeometry(box);
> >setAppearance(new Appearance());
> >
> >I had to use the POLYGON_ARRAY option as the box contains 4,5 ,10,20 sided
> >polygons.
> >The box drawn as a solid or wire frame contains the diagonal line across
> >each of it's faces
> >and is not looking nice.
> >
> The diagonal line is caused by the GeometryInfo
> utility use stripifier to construct triangle array (not QuadArray
^^^^^^^^^^
Kelvin meant to say "triangulator" here. Using POLYGON_ARRAY uses
the triangulator to convert your polygons into triangles.
OpenGL has the concept of n-sided (simple, convex) polygons that can be
drawn in "wireframe" mode (GL_LINE). However, Java 3D does not - we
just have quads and triangles (and fans and strips of triangles). So
this part of OpenGL functionality is hidden from the Java 3D
programmer. The PolygonAttributes object, where you can set
POLYGON_LINE, defines attributes for rendering quads and triangles, not
n-sided polygons. The only place in Java 3D where the concept of
n-sided Polygons is used is in the triangulator, which converts them
into triangles for you.
-Paul
> as mention in your previous mail). So the diagonal line is expected
> in wireframe mode.
>
> >I have checked up on the order of vertices for each face. That seems to be
> >alright.
> >
> >According to your mail it seems like you have solved this problem but that
> >it takes a longer time while using DirectX. Please clarify and suggest if I
> >can do anything else to overcome this problem.
> >
> >My requirement is to allow the user to resize certain standard packaging
> >cartons and boxes interactively by entering their length,width & height.
> >
>
> Since you are using OpenGL version, if the line is missing in wireframe
> mode, it seems a bug either in our GeometryInfo utility or in the
> graphics driver. Can you please send us your complete test program
> for investigation ?
===========================================================================
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".