Hi,Check out the source code of utility GeometryInfo. In
I did something like this: ..... GeometryInfo gi = new GeometryInfo(ga); ga = gi.getIndexedGeometryArray(); .....
ga is an IndexedGeometryArray object and has all its data, I got the following exception:
java.lang.NullPointerException at com.sun.j3d.utils.geometry.GeometryInfo.fillIn(GeometryInfo.java:2348) at com.sun.j3d.utils.geometry.GeometryInfo.getIndexedGeometryArray(GeometryInfo.java:2764) at com.sun.j3d.utils.geometry.GeometryInfo.getIndexedGeometryArray(GeometryInfo.java:2816) ......................
Did I do it wrong or it's a bug? Thanks.
public IndexedGeometryArray getIndexedGeometryArray()
.....
IndexedGeometryArray ga = null;
switch (prim) {
case TRIANGLE_ARRAY:
IndexedTriangleArray ta = new IndexedTriangleArray(vertexCount,
vertexFormat, texCoordSetCount, texCoordSetMap,
coordinateIndices.length);
ga = (IndexedGeometryArray)ta;
break; case QUAD_ARRAY:
IndexedQuadArray qa = new IndexedQuadArray(vertexCount,
vertexFormat, texCoordSetCount, texCoordSetMap,
coordinateIndices.length);
ga = (IndexedGeometryArray)qa;
break;
case TRIANGLE_STRIP_ARRAY:
IndexedTriangleStripArray tsa = new IndexedTriangleStripArray(
vertexCount, vertexFormat, texCoordSetCount,
texCoordSetMap, coordinateIndices.length, stripCounts);
ga = (IndexedGeometryArray)tsa;
break; case TRIANGLE_FAN_ARRAY:
IndexedTriangleFanArray tfa = new IndexedTriangleFanArray(
vertexCount, vertexFormat, texCoordSetCount,
texCoordSetMap, coordinateIndices.length, stripCounts);
ga = (IndexedGeometryArray)tfa;
break;
} // Fill in the GeometryArray object
fillIn(ga, byRef, interleaved, nio); <==== Throw Exception
when ga = NULL
return ga;
}
This happen when primitive is not one of the above 4 types. It may be a bug or improper use of GeometryInfo. Check to see which primitive got form your applications is not handle. Let us know if you find a bug and send us a test program.
Thanks.
- Kelvin ------------------- Java 3D Team Sun Microsystems Inc.
=========================================================================== 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".
