112

Controlling appearance
ColoringAttributes example code

  • Create ColoringAttributes to set an intrinsic color and shading model
    ColoringAttributes myCA = new ColoringAttributes( );
    myCA.setColor( 1.0f, 1.0f, 0.0f );
    myCA.setShadeModel( ColoringAttributes.SHADE_GOURAUD );
  • Create Appearance, set the coloring attributes, and assemble the shape
    Appearance myAppear = new Appearance( );
    myAppear.setColoringAttributes( myCA );
    Shape3D myShape = new Shape3D( myGeom, myAppear );