Example usage for javax.media.j3d LinearFog setInfluencingBounds

List of usage examples for javax.media.j3d LinearFog setInfluencingBounds

Introduction

In this page you can find the example usage for javax.media.j3d LinearFog setInfluencingBounds.

Prototype

public void setInfluencingBounds(Bounds region) 

Source Link

Document

Sets the Fog's influencing region to the specified bounds.

Usage

From source file:EnvironmentExplorer.java

void setupFogs() {
    fogSwitch = new Switch(Switch.CHILD_NONE);
    fogSwitch.setCapability(Switch.ALLOW_SWITCH_WRITE);

    // set up the linear fog
    LinearFog fogLinear = new LinearFog(skyBlue, 6.0f, 12.0f);
    fogLinear.setInfluencingBounds(infiniteBounds);
    fogSwitch.addChild(fogLinear);/*w  w  w  . j a  v  a  2s  . c  o  m*/

    // set up the exponential fog
    ExponentialFog fogExp = new ExponentialFog(skyBlue, 0.3f);
    fogExp.setInfluencingBounds(infiniteBounds);
    fogSwitch.addChild(fogExp);

    // Create the chooser GUI
    String[] fogNames = { "None", "Linear", "Exponential", };
    int[] fogValues = { Switch.CHILD_NONE, 0, 1 };

    fogChooser = new IntChooser("Fog:", fogNames, fogValues, 0);
    fogChooser.addIntListener(new IntListener() {
        public void intChanged(IntEvent event) {
            int value = event.getValue();
            fogSwitch.setWhichChild(value);
        }
    });
    fogChooser.setValue(Switch.CHILD_NONE);
}