Well, hi again...
I am sorry to say that nobody answered so far, and the only poor solution
I have found is to create a new TriangleStripArray like the one I load and
set the coordinates and the colors. The strange thing is that the
.getVertexFormat() on the loaded objects' TriangleStripArray returns 3,
which means that the Array has a Coordinates and Normals but not Colors !!
How can that be ? Where is the color stored ?
> Hello Everyone
> I have to say that I have the exact same problem as Emmanuouel. I'm
> loading an .obj file and I have no trouble displaying it. However, if I
> want to change the TextureCoordinates of the GeometryArray I get an
> ArrayIndexOutofBoundsException. It is interesting that I can get the
> TextureCoordinates but I can not set them. I encountered this problem
> when I tried to change TextureCoordinates for the ColorCube class. Does
> anyone know how I can change the TextureCoordinates of the ColorCube?
> Any help would be greatly appreciated.
>
> Emmanouel Piperakis wrote:
> >
> > I have loaded a Scene with the Lightwave loader. When I display it, it
> > looks fine. I get the Shape3D, then the TriangleStripArray, and try to
> > change some colors. getColor returns negative values ???!!! When I try
> > to setColor with a value returned by getColor I get an
> > ArrayIndexOutOfBoundsException: Color bounds exceeded ...
> > Here is some of my code ...
> >
> > Shape3D shape3D = (Shape3D)tG.getChild(0);
> > shape3D.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
> > shape3D.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
> > TriangleStripArray trA = (TriangleStripArray)shape3D.getGeometry();
> > trA.setCapability(TriangleStripArray.ALLOW_COLOR_READ);
> > trA.setCapability(TriangleStripArray.ALLOW_COLOR_WRITE);
> > trA.setCapability(TriangleStripArray.ALLOW_COORDINATE_READ);
> > trA.setCapability(TriangleStripArray.ALLOW_COORDINATE_WRITE);
> > float[] c4f = new float[4]; // R,G,B,A
> >
> > for(int i=0;i<vertexCount;i++) {
> > trA.getColor(i,c4f);
> > trA.setColor(i,c4f);
> > }
> >
> > Thank you in advance...
> > --
> > Emmanuel Piperakis
> > Electrical & Computer Engineer
> > Computer Science Department
> > Tokyo Institute of Technology
> >
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> > Icq #21095623
> >
> > =====================================================================
> > To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> > Java 3D Home Page: http://java.sun.com/products/java-media/3D/
>
Emmanuel Piperakis
Electrical & Computer Engineer
Computer Science Department
[EMAIL PROTECTED]
[EMAIL PROTECTED]
ICQ #21095623
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/