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
here
and 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.