|
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
|
- [JAVA3D] how do I set an image for bgd? Chris Gates
- Re: [JAVA3D] how do I set an image for bgd? Ching Lai
- Re: [JAVA3D] how do I set an image for bgd? Greg Hopkins
