Hi Michael,

    There is 2 problems in the test program

(1)  In new IndexedTriangleStripArray(vertexCount,
             vertexFormat, indexCount, stripCounts);

  the arguments is set to
  vertexCount = getMin/MaxVertexCount(numVerts)
  indexCount = coords.length;

  This is not correct, it should be

  vertexCount = coords.length/3;
  indexCount = coordIndices.length;

  after fixing this, USE_BY_REFERENCE = true
  will throw ArrayIndexedOutOfBoundsException
  for both USE_GEOMETRY_INFO=true/false

(2) In the case of USE_BY_REFERENCE = false
    and USE_GEOMETRY_INFO = false,
    the texture coordinate is set in the
    program using

    triArray.setTextureCoordinate(0,0, tcoords);

    the correct way should be

    triArray.setTextureCoordinates(0,0, tcoords);

    otherwise only 1 texture coordinate is set
    and the others are zero. That's why texture
    coordinate is incorrect.

    For the case of USE_GEOMETRY_INFO = true
    the utility set it correctly.


In the first case bug 4708566
- setxxxRefxxx() throws ArrayIndexOutOfBounds for valid IndexedGeometryArray

is filed for this. However it will not make into
v1.3 release (too late).

In this example of a cube the number of vertex define in
normal reference array is 6. The normal index count is 24.
The vertex count is 8. The bug happen in indexedGeometry
by reference array which check for

no of vertex in normal array >= vertex count

It should use no. of vertex in indices normal array instead.

The workaround is to add more redundant entries at the end of
color/normal/texture reference array to be set so
that the number of vertex define in those array
is greater or equal to the vertex count.


Thanks for your bug report.

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








>Date: Wed, 26 Jun 2002 14:08:10 +0200
>From: Michael Nischt <[EMAIL PROTECTED]>
>Subject: Re: [JAVA3D] IndexedGeometry and GeometryInfo
>To: [EMAIL PROTECTED]
>MIME-version: 1.0
>Content-transfer-encoding: quoted-printable
>Delivered-to: [EMAIL PROTECTED]
>X-Report-Abuse-To: [EMAIL PROTECTED]
>Comments: To: Chien Yang <[EMAIL PROTECTED]>
>
>Dear Chien,
>
>just wanted to know whether you got time to take a look at the demo's code ?
>
>I've mailed the demo to some other people using Java3D and all asume that
>these two errros are bugs in Java3D..
>Two even think that the texture-coordinate errors I have shown is the same
>they got using the VrmlLoader with Indexed Geometry. it has the same effect.
>but they couldn't figure out the error without the VrmlLoader's source code..
>
>
>greetings
>-Michael Nischt
>
>==========================================================================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".

Reply via email to