I had the same problem and posted it. My solution was to avoid getting vertex coordinates.
I know this exception is only thrown with Java3D 1.3, not with previous realeases.
The problem is that loaders we are using creates GeometryArray in BY_REFERENCE mode, which is a parameter of the constructor.
I'd like to know another way to get vertex coordinates in a TriangleStrip array.
Thanks for your help.
Olivier Tassy <[EMAIL PROTECTED]> a �crit :
Hello,I am trying to get the position of every vertex of a shape3d in a live scene.I use the following code:Shape3D node1 = (Shape3D) shapeTab.get(item1);TriangleArray geom1 = (TriangleArray) node1.getGeometry();Point3d[] coordinates = new Point3d[geom1.getVertexCount()];
for(int n = 0; n < geom1.getVertexCount(); n++)
coordinates[n] = new Point3d();
geom1.getCoordinates(0, coordinates); <<crash hereand I get this message:java.lang.IllegalStateException: GeometryArray: cannot directly access data in B
Y_REFERENCE mode
at javax.media.j3d.GeometryArray.getCoordinates(GeometryArray.java:2743)....shape3d in the shapeTab hashtable have been created, in the main class, with these authorisations.node.setCapability(Shape3D.ALLOW_GEOMETRY_READ);node.getGeometry().setCapability(TriangleArray.ALLOW_COORDINATE_READ);
node.getGeometry().setCapability(TriangleArray.ALLOW_COUNT_READ);thanks for your help,Olivier.
Yahoo! Mail -- Une adresse @yahoo.fr gratuite et en fran�ais !
