Package com.ardor3d.light

Examples of com.ardor3d.light.DirectionalLight


        buf.setEnabled(true);
        buf.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo);
        nodes.getRootNode().setRenderState(buf);

        // ---- LIGHTS
        /** Set up a basic, default light. */
        final DirectionalLight light = new DirectionalLight();
        light.setDirection(-0.37352666, -0.50444174, -0.7784704);
        light.setDiffuse(ColorRGBA.WHITE);
        //light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setEnabled(true);

        /** Attach the light to a lightState and the lightState to rootNode. */
        _lightState = new LightState();
        _lightState.setEnabled(true);
        _lightState.attach(light);
View Full Code Here


        //final RenderPass rootPass = new RenderPass();
        //rootPass.add(rootNode);

        //lightState.detachAll();
        final DirectionalLight light = new DirectionalLight();
        light.setDirection(lightPosition.normalize(null).negateLocal());

        // final PointLight light = new PointLight();
        light.setEnabled(true);
        //lightState.attach(light);
       
       
        //final Light light = _lightState.get(0);
        //if (light instanceof PointLight) {
View Full Code Here

        }

        switch (light.getType()) {
            case Directional: {
                final DirectionalLight dirLight = (DirectionalLight) light;

                final ReadOnlyVector3 direction = dirLight.getDirection();
                setPosition(index, record, -direction.getXf(), -direction.getYf(), -direction.getZf(), 0, lr);
                break;
            }
            case Point:
            case Spot: {
View Full Code Here

        }

        switch (light.getType()) {
            case Directional: {
                final DirectionalLight dirLight = (DirectionalLight) light;

                final ReadOnlyVector3 direction = dirLight.getDirection();
                setPosition(index, record, -direction.getXf(), -direction.getYf(), -direction.getZf(), 0, lr);
                break;
            }
            case Point:
            case Spot: {
View Full Code Here

        }));
    }

    private void setupDefaultStates() {
        _lightState.detachAll();
        final DirectionalLight dLight = new DirectionalLight();
        dLight.setEnabled(true);
        dLight.setAmbient(new ColorRGBA(0.4f, 0.4f, 0.5f, 1));
        dLight.setDiffuse(new ColorRGBA(0.6f, 0.6f, 0.5f, 1));
        dLight.setSpecular(new ColorRGBA(0.3f, 0.3f, 0.2f, 1));
        dLight.setDirection(new Vector3(-1, -1, -1).normalizeLocal());
        _lightState.attach(dLight);
        _lightState.setEnabled(true);

        final CullState cs = new CullState();
        cs.setEnabled(true);
View Full Code Here

        }));
    }

    private void setupDefaultStates() {
        _lightState.detachAll();
        final DirectionalLight dLight = new DirectionalLight();
        dLight.setEnabled(true);
        dLight.setAmbient(new ColorRGBA(0.4f, 0.4f, 0.5f, 1));
        dLight.setDiffuse(new ColorRGBA(0.6f, 0.6f, 0.5f, 1));
        dLight.setSpecular(new ColorRGBA(0.3f, 0.3f, 0.2f, 1));
        dLight.setDirection(new Vector3(-1, -1, -1).normalizeLocal());
        _lightState.attach(dLight);
        _lightState.setEnabled(true);

        final CullState cs = new CullState();
        cs.setEnabled(true);
View Full Code Here

                        / _canvas.getCanvasRenderer().getCamera().getHeight(), 1.0f, farPlane);

        _controlHandle.setMoveSpeed(50);

        _lightState.detachAll();
        final DirectionalLight dLight = new DirectionalLight();
        dLight.setEnabled(true);
        dLight.setAmbient(new ColorRGBA(0.4f, 0.4f, 0.5f, 1));
        dLight.setDiffuse(new ColorRGBA(0.6f, 0.6f, 0.5f, 1));
        dLight.setSpecular(new ColorRGBA(0.3f, 0.3f, 0.2f, 1));
        dLight.setDirection(new Vector3(-1, -1, -1).normalizeLocal());
        _lightState.attach(dLight);
        _lightState.setEnabled(true);

        final CullState cs = new CullState();
        cs.setEnabled(true);
View Full Code Here

        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", MinificationFilter.Trilinear, true));
        opaques.setRenderState(ts);

        final LightState ls = new LightState();
        ls.setEnabled(true);
        final DirectionalLight dLight = new DirectionalLight();
        dLight.setEnabled(true);
        dLight.setDiffuse(new ColorRGBA(1, 1, 1, 1));
        dLight.setDirection(new Vector3(1, 1, 1));
        ls.attach(dLight);
        final DirectionalLight dLight2 = new DirectionalLight();
        dLight2.setEnabled(true);
        dLight2.setDiffuse(new ColorRGBA(1, 1, 1, 1));
        dLight2.setDirection(new Vector3(-1, -1, -1));
        ls.attach(dLight2);
        ls.setTwoSidedLighting(false);
        transps.setRenderState(ls);
        transps.getSceneHints().setLightCombineMode(LightCombineMode.Replace);
View Full Code Here

        final RenderPass rootPass = new RenderPass();
        rootPass.add(_root);

        _lightState.detachAll();
        final DirectionalLight light = new DirectionalLight();
        // final PointLight light = new PointLight();
        light.setEnabled(true);
        _lightState.attach(light);

        // Create pssm pass
        _pssmPass = new ParallelSplitShadowMapPass(light, 1024, 3);
        _pssmPass.add(_root);
View Full Code Here

        manager.setSpatialTarget(obj);
    }

    private void setupDefaultStates() {
        _lightState.detachAll();
        final DirectionalLight dLight = new DirectionalLight();
        dLight.setEnabled(true);
        dLight.setAmbient(new ColorRGBA(0.4f, 0.4f, 0.5f, 1));
        dLight.setDiffuse(new ColorRGBA(0.6f, 0.6f, 0.5f, 1));
        dLight.setSpecular(new ColorRGBA(0.3f, 0.3f, 0.2f, 1));
        dLight.setDirection(new Vector3(-1, -1, -1).normalizeLocal());
        _lightState.attach(dLight);
        _lightState.setEnabled(true);

        final CullState cs = new CullState();
        cs.setEnabled(true);
View Full Code Here

TOP

Related Classes of com.ardor3d.light.DirectionalLight

Copyright © 2018 www.massapicom. 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.