Examples of DirectionalLight


Examples of com.jme.light.DirectionalLight

    }
   
    public void updateLight(final LightNode lightToBeUpdated, final LightNode updatedLightInfo) {
//        removeLightFromRenderer(lightToBeReplaced);
//        addLightToRenderer(lightToBeInserted);
        final DirectionalLight originalLight = (DirectionalLight)lightToBeUpdated.getLight();
        final DirectionalLight freshLight = (DirectionalLight)updatedLightInfo.getLight();
       
        SceneWorker.addWorker(new WorkCommit() {
            public void commit() {
                originalLight.setAmbient(freshLight.getAmbient());
                originalLight.setDiffuse(freshLight.getDiffuse());
                originalLight.setSpecular(freshLight.getSpecular());
                originalLight.setShadowCaster(freshLight.isShadowCaster());
                originalLight.setDirection(freshLight.getDirection());
                lightToBeUpdated.setLocalTranslation(updatedLightInfo.getLocalTranslation());
            }
        });
    }
View Full Code Here

Examples of com.jme.light.DirectionalLight

   * Assemble the lighting.
   *
   */
  protected void buildLighting() {
    // Set up a basic, default light.
    DirectionalLight light = new DirectionalLight();
    light.setDiffuse(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));
    light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
    light.setDirection(new Vector3f(1, -1, 0).normalize());
    light.setEnabled(true);

    // Attach the light to a lightState and the lightState to root.
    LightState lightState = display.getRenderer().createLightState();
    lightState.setEnabled(true);
    lightState.attach(light);
View Full Code Here

Examples of com.jme3.light.DirectionalLight

  }
 
  public void setDirectionalLight(final boolean on) {
    if (dl == null) {
      Vector3f lightDir = new Vector3f(-0.8719428f, -0.46824604f, 0.14304268f);
      dl = new DirectionalLight();
      dl.setColor(new ColorRGBA(1.0f, 0.92f, 0.75f, 1f));
      dl.setDirection(lightDir);

      Vector3f lightDir2 = new Vector3f(0.70518064f, 0.5902297f, -0.39287305f);
      dl2 = new DirectionalLight();
      dl2.setColor(new ColorRGBA(0.7f, 0.85f, 1.0f, 1f));
      dl2.setDirection(lightDir2);
    }
    this.enqueue(new Callable<Integer>(){
      public Integer call() throws Exception {
View Full Code Here

Examples of com.jme3.light.DirectionalLight

    mat.setColor("Color", ColorRGBA.Blue);
    mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
    g.setMaterial(mat);
    rootNode.attachChild(g);

    DirectionalLight sun = new DirectionalLight();
    sun.setDirection(new Vector3f(1,0,-2).normalizeLocal());
    sun.setColor(ColorRGBA.White);
    rootNode.addLight(sun);
   
  }
View Full Code Here

Examples of com.jme3.light.DirectionalLight

                tree_1.getChild(1).setQueueBucket(Bucket.Transparent);
                nd.attachChild(tree_1);
            }
        }

        DirectionalLight dl = new DirectionalLight();
        dl.setDirection(new Vector3f(-0.8f, -0.6f, -0.08f).normalizeLocal());
        dl.setColor(new ColorRGBA(1, 1, 1, 1));
        rootNode.addLight(dl);


        AmbientLight al = new AmbientLight();
        al.setColor(new ColorRGBA(2f, 1.5f, 1.5f, 1f));
View Full Code Here

Examples of com.jme3.light.DirectionalLight

    public void loadCommon() {
       
        Node mainScene = new Node("Main Scene");
        rootNode.attachChild(mainScene);
       
        DirectionalLight sun = new DirectionalLight();
        sun.setDirection(lightDir);
        sun.setColor(ColorRGBA.White.clone().multLocal(1.7f));
        rootNode.addLight(sun);
       
        Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", false);
        sky.setLocalScale(350);
       
View Full Code Here

Examples of com.xith3d.scenegraph.DirectionalLight

      transform.mul(drotY);
      Matrix4f tmp = new Matrix4f(rot);
      tmp.invert();
      transform.mul(tmp);

      DirectionalLight light = scene.getLights()[mode];
      Vector3f direction = light.getDirection();
      transform.transform(direction);
      light.setDirection(direction);
      scene.showLightVector(direction.x,direction.y,direction.z);
     
      // update pos, don't move view
          pos2DX = newX;
          pos2DY = newY;
View Full Code Here

Examples of com.xith3d.scenegraph.DirectionalLight

       
        lights = new DirectionalLight[1];

        for (int i=0; i<lights.length; ++i) {
          // TODO : position lights around the object
            lights[i] = new DirectionalLight(true,new Color3f(1.0f,1.0f,1.0f),new Vector3f(-1,-1,-1));
          rootGroup.addChild(lights[i]);
        }
       
        rootGroup.addChild(branchgroup);
        locale.addBranchGraph(rootGroup);
View Full Code Here

Examples of edu.cmu.cs.stage3.alice.core.light.DirectionalLight

        Light light = null;
        if( sgLight instanceof edu.cmu.cs.stage3.alice.scenegraph.AmbientLight ) {
          AmbientLight ambientLight = new AmbientLight();
          light = ambientLight;
        } else if( sgLight instanceof edu.cmu.cs.stage3.alice.scenegraph.DirectionalLight ) {
          DirectionalLight directionalLight = new DirectionalLight();
          light = directionalLight;
        } else if( sgLight instanceof edu.cmu.cs.stage3.alice.scenegraph.PointLight ) {
          PointLight pointLight = null;
          if( sgLight instanceof edu.cmu.cs.stage3.alice.scenegraph.SpotLight ) {
            SpotLight spotLight = new SpotLight();
View Full Code Here

Examples of javax.media.j3d.DirectionalLight

        lights = new DirectionalLight[1];

        for (int i=0; i<lights.length; ++i) {
          // TODO : position lights around the object
            lights[i] = new DirectionalLight(true,new Color3f(1.0f,1.0f,1.0f),new Vector3f(-1,-1,-1));
            lights[i].setCapability(DirectionalLight.ALLOW_DIRECTION_READ);
            lights[i].setCapability(DirectionalLight.ALLOW_DIRECTION_WRITE);
            lights[i].setCapabilityIsFrequent(DirectionalLight.ALLOW_DIRECTION_READ);
            lights[i].setCapabilityIsFrequent(DirectionalLight.ALLOW_DIRECTION_WRITE);
            lights[i].setEnable(true);
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.