< Zurück | Inhalt | Weiter >

From SplineInterpolatorTest.java


//we want a texture−mapped background of a sky protected Background createBackground()

{

//add the sky backdrop

Background back = new Background(); back.setApplicationBounds( getApplicationBounds() );


BranchGroup bgGeometry = new BranchGroup();


//create an appearance and assign the texture image Appearance app = new Appearance();

Texture tex = new TextureLoader( "sky.gif", this).getTexture(); app.setTexture( tex );


Sphere sphere =

new Sphere( 1.0f, Primitive.GENERATE_TEXTURE_COORDS |

Primitive.GENERATE_NORMALS_INWARD,

app );


bgGeometry.addChild( sphere ); back.setGeometry( bgGeometry );


return back;

}


image