public void setupLighting() {
        Geometry lightMdl;
        AmbientLight al = new AmbientLight();
        al.setColor(ColorRGBA.White.mult(2f));
        rootNode.addLight(al);

        direction = new DirectionalLight();
        direction.setColor(ColorRGBA.White.mult(10));
        rootNode.addLight(direction);

        lightMdl = new Geometry("Light", new Dome(Vector3f.ZERO, 2, 32, 5, false));
        lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
        lightMdl.setLocalTranslation(new Vector3f(0, 0, 0));
        lightMdl.setLocalRotation(new Quaternion().fromAngles(FastMath.PI / 2F, 0, 0));
        rootNode.attachChild(lightMdl);

        /*
         * We need this Dome doesn't have a "floor."
         */
        Geometry lightFloor = new Geometry("LightFloor", new Cylinder(2, 32, 5, .1F, true));
        lightFloor.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
        lightFloor.getMaterial().setColor("Color", ColorRGBA.White);

        lightNode = new Node();
        lightNode.addControl(new LightControl(direction));
        lightNode.attachChild(lightMdl);
        lightNode.attachChild(lightFloor);
        rootNode.attachChild(lightNode);
    }
Creates a directional light controlled by rotating a node. The light will shine on a surrounding sphere.
The light will rotate on each axis, then on a random axis, then return to the X
axis.

@author Markil 3
jme3-examples/src/main/java/jme3test/light/TestLightControlDirectional.java