Skip to main content

Fog and Multiple Views

4 replies [Last post]
wrightmf
Offline
Joined: 2003-12-16
Points: 0

Hello all...

I'm having an issue with fog and multiple views. I have a Java3D application that contains multiple canvases and views. I only want fog in one of those views. Each view has its own camera (with its own TransformGroup), and I only add fog to one of these cameras. The problem I'm having is that fog appears in all my views, regardless of which view I add the fog to. I have verified by inspecting the scenegraphs of each view that the LinearFog node only appears in the camera transform for my target view, yet the effect of that fog overtakes all my views.

Before I go tearing through my code to see if I've done something stupid, is this a known limitation? Is fog, by being an environmental effect, limited to affecting all views?

Thanks!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chris_j_pook
Offline
Joined: 2005-01-27
Points: 0

>> I have a Java3D application that contains multiple
>> canvases and views.

Hi, I found your post while trying to find out how to get multiple views in Java3D. What I want is to have a seperate JFrame for each view all displaying the same sceneGroup in one universe.

Does your application use multiple views in this way ?

If yes, is there any chance you can show me the code that will enable this...

Thanks for any help

Chris?

ostenl
Offline
Joined: 2004-11-06
Points: 0

You must put your fog into a ViewSpecificGroup, specifying which view(s) it shall be visible in.

See javax.media.j3d.ViewSpecificGroup

/ol

wrightmf
Offline
Joined: 2003-12-16
Points: 0

Works great ostenl... THANKS!

nitro
Offline
Joined: 2004-09-12
Points: 0

Iam really no expert in Java3D. But I think everything on your example is working as It should because it does not matter in which branch (e.g view) you attach the fog, but which are its influencing bounds. So all the views that touch the influencing bounds (or are in the scope list) of the fog will see fog. No matter if you attached it to a "view branch" or a "content branch", it is just a part of the tree and therefore will be visible in all views. That will say in my understanding you do not add fog to a view but to a scene.
I hope my explanation are somewhat understandable.

I am not sure if I am correct I just started myself with Java3D.