The Stripifier rearranges the data to get the longest strips possible.
It does not preserve the order that you inputed the
coordiates/triangles. Your code is behaving as expected.
andrea
Lan Wu-Cavener wrote:
>
> Sorry that I didn't include the full code. Here I attach two files to show
> the problem I have.
>
> The triangle vertices are input in the following order ( (1,2) (3,4) - ()
> represents a block, ea. contains 2 triagles
> (5,6) (7,8)
> (9,10)(11,12))
>
> I casted the output of GeomtryInfo.getGeometryArray to TriangleStripArray
> and then set the capability bits in TestUniverse.java.
>
> Later in the MenuDemo.java as a response to menu click, I use
> Shape3D.getGeometry() to trace back the geometry. The order of the vertices
> is from bottom up. If I use a block (made of 2 triangles) to describe the
> problem the order of the blocks is as follows
> ((6)(5) - () represents a
> block (quad)
> (4)(3)
> (2)(1) )
>
> you will see what I mean in the menuDemo, when "restore color" clicked, I
> set color in a reverse order.
> i hope that I stated clear enough for you to figure out.
>
> Thanks again!
>
> At 06:04 PM 5/31/2001 -0700, you wrote:
> >Lan,
> >
> >I'm not sure I understand exactly what you are asking. The code you
> >have below does not call the Stripifier at all. However, you should set
> >the color of your data before you call the stripifier. Color
> >information is used for building strips. Please send me a short demo
> >program if you are having problems.
> >
> >andrea
> >
> >
> >Lan Wu-Cavener wrote:
> > >
> > > Hi, all:
> > >
> > > I used the GeometryInfo to read in Triangle_Array. After calling
> > > stripifier, I retrieve the GoemetryArray using shape3D. getGeometry().
> > >
> > > Then when I use GeometryArray.setColor(int index, Color3f color), I found
> > > the triangles are number in a reverse order respective to their original
> > > input order. For instance, I have a trip of 4 triangles which are input in
> > > the order from left to right. After I called all the aforementioned
> > > functions, The ".setColor(index, black) with index from 0-3 will set the
> > > vertex 0 to 3 of the right most triangle to black.
> > >
> > > I have tried couple of time, one with the IndexedGeometryArray, I found the
> > > same results.
> > > Could any one confirm that is what it should be? Thanks!
> > >
> > > Lan
> > >
> > > GeometryInfo gi1 = new GeometryInfo(GeometryInfo.TRIANGLE_ARRAY);
> > > gi1.setCoordinates(tvertices);
> > > gi1.setCoordinateIndices(tvertex_ind);
> > > gi1.setColors(colors);
> > > gi1.setColorIndices(tcolor_ind);
> > > Lan Wu-Cavener
> > > Research Associate and Programmer
> > > Dept. of Landscape Architecture
> > >
> > > ===========================================================================
> > > 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".
>
> ------------------------------------------------------------------------
> Name: TestUniverse.java
> TestUniverse.java Type: Plain Text (text/plain)
> Encoding: quoted-printable
>
> MenuDemo.javaName: MenuDemo.java
> Type: Plain Text (text/plain)
>
> ------------------------------------------------------------------------
> Lan Wu-Cavener
> Research Associate and Programmer
> Dept. of Landscape Architecture
===========================================================================
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".