Example usage for javax.media.j3d DirectionalLight ALLOW_DIRECTION_WRITE

List of usage examples for javax.media.j3d DirectionalLight ALLOW_DIRECTION_WRITE

Introduction

In this page you can find the example usage for javax.media.j3d DirectionalLight ALLOW_DIRECTION_WRITE.

Prototype

int ALLOW_DIRECTION_WRITE

To view the source code for javax.media.j3d DirectionalLight ALLOW_DIRECTION_WRITE.

Click Source Link

Document

Specifies that the Node allows writing to its object's direction information.

Usage

From source file:ExDirectionalLight.java

public Group buildScene() {
    // Get the current color and direction
    Color3f color = (Color3f) colors[currentColor].value;
    Vector3f dir = (Vector3f) directions[currentDirection].value;

    // Turn off the example headlight
    setHeadlightEnable(false);//from ww  w .ja v  a 2s  .  co m

    // Build the scene group
    Group scene = new Group();

    // BEGIN EXAMPLE TOPIC
    // Create influencing bounds
    BoundingSphere worldBounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), // Center
            1000.0); // Extent

    // Set the light color and its influencing bounds
    light = new DirectionalLight();
    light.setEnable(lightOnOff);
    light.setColor(color);
    light.setDirection(dir);
    light.setCapability(DirectionalLight.ALLOW_STATE_WRITE);
    light.setCapability(DirectionalLight.ALLOW_COLOR_WRITE);
    light.setCapability(DirectionalLight.ALLOW_DIRECTION_WRITE);
    light.setInfluencingBounds(worldBounds);
    scene.addChild(light);
    // END EXAMPLE TOPIC

    // Build foreground geometry
    scene.addChild(new SphereGroup());

    // Add anotation arrows pointing in +-X, +-Y, +-Z to
    // illustrate aim direction
    scene.addChild(buildArrows());

    return scene;
}

From source file:LightTest.java

protected int[] getCapabilities() {
    int[] superCaps = super.getCapabilities();

    int[] caps = { DirectionalLight.ALLOW_DIRECTION_READ, DirectionalLight.ALLOW_DIRECTION_WRITE, };

    return createCompoundArray(superCaps, caps);
}