//Generate a background in the colour of the fog.
Color3f fogColour = new Color3f(0.5f,0.5f,0.5f);
Background bg = new Background(fogColour);
BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE);
bg.setApplicationBounds(bounds);
theScene.addChild(bg);
//Generate exponential fog.
ExponentialFog fog = new ExponentialFog(fogColour,6.0f);
fog.setInfluencingBounds(bounds);