Hi Robert,

>
>I've been trying to use IndexedGeometryArrays of various sorts lately and
haven't had much luck finding detailed documentation on them.  From what I've
seen (correct me if I'm overlooking something), neither the Javadocs nor the
tutorial nor j3d.org nor the Java3D spec seem to have any very useful
documentation on the expected layout of indices for the various subclasses.  I
expected that I'd be able to use these classes fairly naturally by appling what
(little) I know from OpenGL, but so far my attempts have been less than fully
successful.  Does anyone have any good documentation references explaining how
the various IndexedGeometryArray subclasses expect their indices to be laid out?
>
>Here are a couple of specific questions:
>
>1) I'm working on a bit of code in which I'd like to use by-ref
IndexedTriangleArrays.  I've generated a great deal of data to use with them,
and have generated even more index data to connect the vertices.  After some
debugging, the generated vertices and indices seem to be exatly what I'd expect
to see, but the resulting geometry drawn on screen is NOTHING like what I'm
expecting (I won't even try to describe it at the moment).  My best guess at
this point is that my assumption about how this class expects its index data is
incorrect.  Presently, I'm working under the assumption that to create a quad
from two triangles, the following approach would be correct (ASCII art follows):
>
>   ul   ur
>    *---*
>    |\  |
>    | \ |
>    |  \|
>    *---*
>   ll   lr
>
>So, I've generated vertex data for each of ul, ur, ll, and lr.  Next I generate
index data, which is formatted like this:  Triangle 1 == ul, ll, lr.  Triangle 2
== lr, ur, ul (3 vertex indices per tri with CCW winding).  So now what I think
I've done is generated two triangles based on my vertex data (4 vertices, 6
indices).  But when I actually render the geometry, I see some very stange
things.  My assumption now is that I'm using the index array incorrectly.  Can
anyone confirm or deny that?

Using the flag

 USE_COORD_INDEX_ONLY

in vertexFormat will prevent Java3D unindexify the array
before passing down to OpenGL/D3D. Note that Quad primitive
is not support by D3D so the DirectX version of Java3D
will construct another index before passing down for Quad.


>
>2) I've read recently that when working with triangle strips in OpenGL, you can
insert some sort of trivial triangle (3 points in the same place?) and get
OpenGL to auto-reverse the winding for the next series of triangles in the strip
effectively allowing one to create a triangle strip that winds back and forth
across a surface.  Is it possible to do something like this with the
(Indexed)TriangleStripArrays?
>

This is not support in Java3D

Thanks.

- Kelvin
---------------
Java 3D Team
Sun Microsystems Inc.

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