public BranchGroup createSceneGraph() { // Create the root of the branch graph BranchGroup objRoot = new BranchGroup(); ... // Load in the Texture File TextureLoader loader = new TextureLoader("brick.jpg",this) // Create Texture object Texture brick = loader.getTexture(); // Create Appearance Object Appearance appearance = new Appearance(); // Create Appearance Attributes and give to Appearance. // TextureAttributes can be used for transforming texture (e.g. scaling) TextureAttributes ta = new TextureAttributes(); appearance.setTextureAttributes(ta); // Attach Texture object to Appearance object appearance.setTexture(brick); // Create Shape object and assign it the Appearance object. Sphere mySphere = new Sphere(0.7f,Primitive.GENERATE_TEXTURE_COORDS,appearance); ... return objRoot; }