CG,
 
Here is sample code to create image for scene background. Assume
_canvas3D and _topTG is an instance of Canvas3D and TransformGroup
you created early.
 
   // Create the root of the branch graph
            BranchGroup objRoot = new BranchGroup() ;
            // Create mouse behavior scheduling bounds.
            BoundingSphere bounds =
                new BoundingSphere(new Point3d(0.0,0.0,0.0), 500.0) ;
    
            objRoot.addChild(_topTG) ;
 
            // Set up the background
            Color3f bgColor = new Color3f(0.0f, 0.0f, 0.0f) ;
            Background bgNode = new Background(bgColor) ;
            bgNode.setApplicationBounds(bounds) ;
            
            TextureLoader  tex = new TextureLoader("images/topo_floor.jpg", "RGB", _canvas3D);
            ImageComponent2D img = tex.getImage();
            bgNode.setImage(img);
           
            objRoot.addChild(bgNode) ;
           
Ching
-----Original Message-----
From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]]On Behalf Of Chris Gates
Sent: Wednesday, June 14, 2000 5:49 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] how do I set an image for bgd?

How do I set an image as the background of a scene?
 
Much thanks in advance,
CG

Reply via email to