Hi Mr. Kevin and Mr. Peter,

Thanks for your help. It works well after I change "+" to "|".   Where can I get the 
values of such constants as
ALLOW_COLOR_WRITE, ALLOW_COORDINATE_WRITE ...  ?   Usually such constants are
1, 2, 4, 8, 16, 32,,...., so the operations of PLUS and OR get the same result. How 
Sun Java3D deals with
these constants.

Thanks !

-WuGang

Kevin Rushforth wrote:

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



--

-------------------------------------
Name:Zhao WuGang
Integrated Media System Center
Dept. of Computer Science
Univ. of Southern California

Addr.
2633 Ellendale Place, Apt. 106
Los Angeles, CA 90007
Tel: 213-740-2295(office)
323-731-6509(home)
Email: [EMAIL PROTECTED]
URL: http://shemiran.usc.edu/wugangzh/
 http://shemiran.usc.edu/genesis/
Office: PHE-434


=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to