85

Building 3D shapes
LineArray example code

  • Create a list of 3D coordinates for the vertices
    Point3f[] myCoords = {
        new Point3f(  0.0f, 0.0f, 0.0f ),
        . . .
    }
  • Create a LineArray and set the vertex coordinates
    LineArray myLines = new LineArray(
        myCoords.length,
        GeometryArray.COORDINATES );
    myLines.setCoordinates( 0, myCoords );

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