163

Transforming shapes
TransformGroup example code

  • Build a shape
    Shape3D myShape = new Shape3D( myGeom, myAppear );

  • Create a 3D transform for a +1.0 translation in X
    Transform3D myTrans3D = new Transform3D( );
    myTrans3D.set( new Vector3d( 1.0, 0.0, 0.0 ) );

  • Create a transform group, set the transform, and add the shape
    TransformGroup myGroup = new TransformGroup( );
    myGroup.setTransform( myTrans3D );
    myGroup.addChild( myShape );