Re: How to find the vertices of a 3D shape?

by enkonyito » Mon Nov 05, 2018 4:31 pm

I use your tutorial to complete my information on the Javadoc of Java3D.

In [font=courier new]geometryArray[/font], the data about the object of any shape that I want to find the vertices is stored.

Code: Select all

[...]
} else if (node instanceof Shape3D) {
    Shape3D shape = (Shape3D)node;
    [...]
    // Read object geometries
    for (int i = 0, n = shape.numGeometries(); i < n; i++) {
      readNodeGeometry(shape.getGeometry(i), parentTransformations, texCoordGeneration,
          textureTransform, cullFace, backFaceNormalFlip);
    }
[...]

[...]
private void readNodeGeometry(Geometry geometry,
                              Transform3D parentTransformations,
                              TexCoordGeneration texCoordGeneration,
                              Transform3D textureTransform,
                              int cullFace,
                              boolean backFaceNormalFlip) {
  if (geometry instanceof GeometryArray) {
    GeometryArray geometryArray = (GeometryArray)geometry;
[...]
The ideal would be to force to use [font=courier new]TRIANGLE_ARRAY[/font].