83

Building 3D shapes
PointArray example code

  • Create a list of 3D coordinates for the vertices
    Point3f[] myCoords = {
        new Point3f(  0.0f, 0.0f, 0.0f ),
        . . .
    }

  • Create a PointArray and set the vertex coordinates
    PointArray myPoints = new PointArray(
        myCoords.length,
        GeometryArray.COORDINATES );
    myPoints.setCoordinates( 0, myCoords );

  • Assemble the shape
    Shape3D myShape = new Shape3D( myPoints, myAppear );