We have code that has one way of doing this in NCSA Portfolio's Display
program, which we include as source in the download:
BranchGroup group = new BranchGroup();
group.setCapability(Group.ENABLE_PICK_REPORTING);
BoundingSphere bounds = new BoundingSphere(new
Point3d(0.0,0.0,0.0),2000000.0);
Color3f bgColor = new Color3f(0.17f, 0.65f, .92f);
Background bg = new Background(bgColor);
bg.setApplicationBounds(bounds);
group.addChild(bg);
Don't worry about the Group.ENABLE_PICK_REPORTING. It's for another part of
the app.
Steve
Julian Bunn wrote:
> No matter what I do, I cannot seem to make the background for
> my Canvas3D remain anything other than black!
>
> Just after creating the Canvas3D object, I setBackground(Color.white),
> and this is successful, but only for a short while. Then the background
> reverts to black. I don't make any other calls to setBackground on the
> Canvas3D.
>
> I must be doing something stupid, but I can't see it. Has anyone
> suggestions for what I could check (I already looked in the J3D FAQ) ?
>
> Thanks,
>
> Julian
>
> --->
> Julian J. Bunn (Caltech/CERN) | Phone: +1 626 395 6681 | ICQ: 12398412
> 256-48 HEP, Caltech | Email: [EMAIL PROTECTED]
> 1200 E. California Blvd. | GIOD: http://pcbunn.cithep.caltech.edu/
> Pasadena, CA 91125, USA | Home:
> http://pcbunn.cithep.caltech.edu/jjb.html
>
> =====================================================================
> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> Java 3D Home Page: http://java.sun.com/products/java-media/3D/
--
Steve Pietrowicz - [EMAIL PROTECTED] Project Manager - NCSA Java 3D Group
NCSA Portfolio: http://havefun.ncsa.uiuc.edu/Java3D/portfolio/
New Beta 2a release! New Loaders, record and replay of your
Java 3D apps and more! Freely available for non-commercial use!
You Build It VR: http://havefun.ncsa.uiuc.edu/Java3D/YouBuildItVR/
Build your own multi-user virtual worlds with no programming experience!
The Java3D FAQ: http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html
Java News Network: http://tintoy.ncsa.uiuc.edu/~srp/java/javanews.html
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/