480

Creating backgrounds
Background image example code

  • Load a texture image
    TextureLoader myLoader = new TextureLoader( "stars2.jpg", this );
    ImageComponent2D myImage = myLoader.getImage( );

  • Create a background
    Background myBack = new Background( );
    myBack.setImage( myImage );

  • Set the application bounds
    BoundingSphere myBounds = new BoundingSphere(
        new Point3d( ), 1000.0 );
    myBack.setApplicationBounds( myBounds );