Fog not visible

I can’t get fog to work (Exponential or Linear). Is there something extra that has to be done appart from adding it to the scene BranchGroup?

I have a simple box and ground created from odejava, with a directional and ambient light. All works well, except no fog. Here is how I create and add the fog:


float color = 0.66f;
Fog fog = new LinearFog(new Color3f(color, color, color), 10.0f, 100.0f);
scene.addChild(fog);

// or

float color = 0.66f;
Fog fog = new ExponentialFog(new Color3f(color, color, color), 1.0f);
scene.addChild(fog);

I’ve tried various distance values. My box is 1x1x1 units and is about 5 units away from the camera.

I think Fog isn’t yet there in Xith (implemented I mean; the classes are there). At least it hasn’t been there when I tried to use them months ago.
However I’m not up to date currently.

I was thinking maybe that the reason that your code wasn’t working was because you hadn’t called the setInfluencingBounds(new BoundingSphere(new Point3f(), 1000.0f)); method to set the bounds of the ExponentialFog node. But I tried that and it didn’t seem to work either for me.

It would seem that Xith3D doesn’t have fog support yet?
:-/

Ahhh, good to see the javadoc’s make this very clear :-[ (i fell over the same problem) - a quick line in the javadoc stating “this hasn’t been implemented yet” would save a lot of people a lot of hassle finding this out

I’m not having a dig has you guys do a great job, just how long would that take to do? (I mean the comment not implement the fog feature) :wink:

As has already been discussed in another thread, a list of features not implemented [yet] on the xith.org page would be useful for things like this. :slight_smile:

Hi,

Guys, if you really want some feature to come to Xith3D faster, I would ask you to make a test example of the feature (as simple as possible) in Java3D and file an enhancement issue. This was working fine with Texture3D - check threads in this forum few weeks ago… and recoginze that Texture3D support is already here.

The test cases really help me to add new features to Xith3D core and save a lot of time.

Yuri