hi there,
I thought since j3d beta the VertexArray's length needn't to be equal -
only the length of the IndexArrays must.
but follwowing code:
int vertexFormat = IndexedTriangleArray.COORDINATES |
IndexedTriangleArray.NORMALS
| IndexedTriangleArray.TEXTURE_COORDINATE_2
| IndexedTriangleArray.BY_REFERENCE;
triArray = new IndexedTriangleArray(coords.length / 3,
vertexFormat, coordIndices.length);
triArray.setCoordRefFloat(coords);
triArray.setNormalRefFloat(normals);
triArray.setTexCoordRefFloat(0, texCoords);
triArray.setCoordinateIndices(0, coordIndices);
triArray.setNormalIndices(0, normalIndices);
triArray.setTextureCoordinateIndices(0, 0, texCoordIndices);
throws:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:
GeometryArray: texture coord array length is incorrect
at
javax.media.j3d.GeometryArrayRetained.setTexCoordRefFloat(GeometryArrayRetained.java:8766)
at
javax.media.j3d.GeometryArray.setTexCoordRefFloat(GeometryArray.java:5368)
at test.GeomIO.load(GeomIO.java:224)
with:
coords.length = 2418
normals.length = 2438
texCoords.length = 956
and all IndexArrays are at: 2337
without texCoords (though normals.length != coords.length) everything is
working correct, so I'm asking mtself what i have done wrong ?
btw. why I still have to set the vertexCount for IndexedGeometryArrays ?
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".