Skip to main content

Geometryinfo with indexed & by reference geometryarray

No replies
ylliac
Offline
Joined: 2009-06-19
Points: 0

Hi,

I have a serious issue with Geometryinfo. I want to get coords and indices from any geometryarray so i wrote this code :

GeometryInfo info = new GeometryInfo(geomArray);
info.convertToIndexedTriangles();
Point3f[] points = info.getCoordinates();
int[] facets = info.getCoordinateIndices();

I thought that would work but i tried it with and indexedgeometryarray (triangles i think) with "by reference" mode and that gave me that :

Exception in thread "main" java.lang.IllegalStateException: IndexedGeometryArray: cannot access indices directly in BY_REFERENCE_INDICES mode
at javax.media.j3d.IndexedGeometryArray.getCoordinateIndices(IndexedGeometryArray.java:932)
at com.sun.j3d.utils.geometry.GeometryInfoGenerator.processIndexedArray(GeometryInfoGenerator.java:795)
at com.sun.j3d.utils.geometry.GeometryInfoGenerator.create(GeometryInfoGenerator.java:126)
at com.sun.j3d.utils.geometry.GeometryInfoGenerator.create(GeometryInfoGenerator.java:87)
at com.sun.j3d.utils.geometry.GeometryInfo.(GeometryInfo.java:233)

The fact is in the code og GeometryInfoGenerator, the method processGeometryArray() handle by reference mode whereas processIndexedArray() doesn't ...

Is it a bug ? Is there any workaround to get indices and coords from any geometry ?

Hope somebody has the answer :D

Antoine