Example usage for javax.media.j3d PointLight ALLOW_POSITION_WRITE

List of usage examples for javax.media.j3d PointLight ALLOW_POSITION_WRITE

Introduction

In this page you can find the example usage for javax.media.j3d PointLight ALLOW_POSITION_WRITE.

Prototype

int ALLOW_POSITION_WRITE

To view the source code for javax.media.j3d PointLight ALLOW_POSITION_WRITE.

Click Source Link

Document

Specifies that this PointLight node allows writing its position information.

Usage

From source file:ExPointLight.java

public Group buildScene() {
    // Get the current color, position, and attenuation
    Color3f color = (Color3f) colors[currentColor].value;
    Point3f pos = (Point3f) positions[currentPosition].value;
    Point3f atten = (Point3f) attenuations[currentAttenuation].value;

    // Turn off the example headlight
    setHeadlightEnable(false);/*from w ww  .j  a v a2  s .c  o m*/

    // Build the scene root
    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 PointLight();
    light.setEnable(lightOnOff);
    light.setColor(color);
    light.setPosition(pos);
    light.setAttenuation(atten);
    light.setCapability(PointLight.ALLOW_STATE_WRITE);
    light.setCapability(PointLight.ALLOW_COLOR_WRITE);
    light.setCapability(PointLight.ALLOW_POSITION_WRITE);
    light.setCapability(PointLight.ALLOW_ATTENUATION_WRITE);
    light.setInfluencingBounds(worldBounds);
    scene.addChild(light);
    // END EXAMPLE TOPIC

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

    // Add arrows in a fan to show light ray directions
    scene.addChild(buildArrows());

    return scene;
}

From source file:LightTest.java

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

    int[] caps = { PointLight.ALLOW_ATTENUATION_READ, PointLight.ALLOW_ATTENUATION_WRITE,
            PointLight.ALLOW_POSITION_READ, PointLight.ALLOW_POSITION_WRITE };

    return createCompoundArray(superCaps, caps);
}