This is not quite correct.  The problem is that the ALLOW_COLOR_WRITE
and ALLOW_COORDINATE_WRITE flags are capability bits, not format
constants.  Capability bits are meant for use in the set/clear
Capability calls (one at a time---do not try to OR them together).
Better yet, don't set the capability bits at all unless you really need
to modify the data in the point array after the point array is made
live.

-- 
Kevin Rushforth
Java 3D Team
Sun Microsystems

[EMAIL PROTECTED]


>From: Peter Connolly <Peter.Connolly@Aus>
>Date: Tue, 5 Jan 1999 14:34:21 +0800 (WST)
>Subject: Re: [java3d] Strange: java.lang.ArrayIndexOutOfBoundsException: 
>GeometryArray: color array bounds exceeded
>To: [EMAIL PROTECTED]
>Cc: [EMAIL PROTECTED]
>
>Hi WuGang,
>
>Try using the OR operator "|" instead of "+" in your constructor vertexFormat
>parameter and things will work much better.
>
>PointArray pa = new PointArray(10000, PointArray.COORDINATES |
>PointArray.COLOR_3 | PointArray.ALLOW_COLOR_WRITE |
>PointArray.ALLOW_COORDINATE_WRITE);
>
>Regards,
>Peter.
>
>> Hi All,
>> 
>> 
>> I use PointArray to display some points.  I set coordinates of these
>> points successfully , but when I set
>> the colors of these points, an exception is generated, and it says:"
>> java.lang.ArrayIndexOutOfBoundsException: GeometryArray: color array
>> bounds exceeded".
>> In fact, the array index is not out of bounds, and i can display their
>> values.  I don't know why. Who has
>> such experience ? I will be appreciated at any suggestions !
>> 
>> Thanks!
>> 
>> -WuGang
>> 
>> ---------------------------segment of the program------------------
>>  PointArray pa = new PointArray(10000, PointArray.COORDINATES +
>> PointArray.COLOR_3 + PointArray.ALLOW_COLOR_WRITE +
>> PointArray.ALLOW_COORDINATE_WRITE);
>> 
>> 
>> /* System.out.println(coords[0].toString());
>>  System.out.println(coords[1].toString());
>>  System.out.println(coords[2].toString());
>>  System.out.println(coords[3].toString());
>> 
>>  System.out.println(colors[0].toString());
>>  System.out.println(colors[1].toString());
>>  System.out.println(colors[2].toString());
>>  System.out.println(colors[3].toString());
>> */
>>  pa.setCoordinates(0, coords, 0, VertexCount );
>> 
>>  pa.setColors(0, colors, 0, VertexCount );
>> 
>> 
>> 
>> =====================================================================
>> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
>> Java 3D Home Page: http://java.sun.com/products/java-media/3D/
>
>
>=====================================================================
>To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
>Java 3D Home Page: http://java.sun.com/products/java-media/3D/
>
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to