Examples of DirectionalLight


Examples of javax.media.j3d.DirectionalLight


    //Directional light (to be rotated).
    Color3f lightColour = new Color3f(1.0f, 1.0f, 1.0f);
    Vector3f lightDir  = new Vector3f(0.0f, 0.0f, -1.0f);
    DirectionalLight light = new DirectionalLight(lightColour, lightDir);
    light.setInfluencingBounds(bounds);

    //The transformation group for the directional light and its rotation.
    TransformGroup tfmLight = new TransformGroup();
    tfmLight.addChild(light);
View Full Code Here

Examples of javax.media.j3d.DirectionalLight

    BranchGroup bgLight = new BranchGroup();

    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
    Color3f lightColour1 = new Color3f(1.0f,1.0f,1.0f);
    Vector3f lightDir1  = new Vector3f(-1.0f,0.0f,-0.5f);
    DirectionalLight light1 = new DirectionalLight(lightColour1, lightDir1);
    light1.setInfluencingBounds(bounds);

    bgLight.addChild(light1);
    su.addBranchGraph(bgLight);
  }
View Full Code Here

Examples of javax.media.j3d.DirectionalLight


    //Directional light.
    Color3f lightColour = new Color3f(1.0f, 1.0f, 1.0f);
    Vector3f lightDir  = new Vector3f(1.0f, -1.0f, -1.0f);
    DirectionalLight light = new DirectionalLight(lightColour, lightDir);
    light.setInfluencingBounds(bounds);
    bgLight.addChild(light);



    //Ambient light.
View Full Code Here

Examples of javax.media.j3d.DirectionalLight

        AmbientLight lightAmbient = new AmbientLight(new Color3f(0.8f, 0.8f,
                0.8f));
        lightAmbient.setInfluencingBounds(_bounds);
        lightRoot.addChild(lightAmbient);

        DirectionalLight lightDirectional = new DirectionalLight();
        lightDirectional.setInfluencingBounds(_bounds);

        Vector3f direction = new Vector3f(0.0f, -1.0f, -1.0f);
        direction.normalize();
        lightDirectional.setDirection(direction);
        lightDirectional.setColor(new Color3f(1.0f, 1.0f, 1.0f));
        lightRoot.addChild(lightDirectional);

        _simpleUniverse.getViewer().getView().setLocalEyeLightingEnable(true);
        _simpleUniverse.addBranchGraph(lightRoot);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.