Elisabeth Thorsen wrote:

Hi,
I am trying to use an IndexedTriangleArrray but run into a problem when I try to use the setColors method.

IndexedTriangleArray(verticeLength,                GeometryArray.COORDINATES |
GeometryArray.USE_COORD_INDEX_ONLY |
GeometryArray.COLOR_3, indexLength);

When I use the setColors(0,colorArray) method I get the following exception
java.lang.ArrayIndexOutOfBoundsException: 4472720
       at javax.media.j3d.GeometryArrayRetained.setColors(GeometryArrayRetained.java:4141)
       at javax.media.j3d.GeometryArray.setColors(GeometryArray.java:1468)

The length of the color array is the same as the length of the indices (indexLength).  (It differs from the vertex count because I am calculating color after being lit at each vertex for all the triangles. This is done to avoid setting the normals.)

What am I doing wrong?

Elisabeth Thorsen

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


This may related to bugs:
4708566 setxxxRefxxx() throws ArrayIndexOutOfBounds for valid
IndexedGeometryArray
4749885 setxxxRefxxx() did not check index limit correctly for
IndexedGeometryArray

which are fixed in v1.3.1 beta1. Give this a try :

http://developer.java.sun.com/developer/earlyAccess/java3D/index.html


- 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