Package javax.media.j3d

Examples of javax.media.j3d.AmbientLight


        }

        // Setup the lights.
        BranchGroup lightRoot = new BranchGroup();

        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);
View Full Code Here


    private final Sun3D sun3D;

    public BasicLights(Sun3D sun3D) {
        lightsGroup = new BranchGroup();
        ambientLight = new AmbientLight(ColorConstants.grey);
        ambientLight.setInfluencingBounds(bounds);
        lightsGroup.addChild(ambientLight);

        this.sun3D = sun3D;
        lightsGroup.addChild(sun3D.getLight());
View Full Code Here

        if (state == null) {
            throw new IllegalArgumentException("Null environment3D state");
        }
        this.state = state;
        this.environment = environment;
        ambientLight = new AmbientLight(ColorConstants.grey);
        ambientLight.setInfluencingBounds(bounds);
        group = new BranchGroup();
        group.addChild(ambientLight);
        group.addChild(getSun3D().getLight());
    }
View Full Code Here

   
    private void lightScene() {
      Color3f white = new Color3f(1.0f, 1.0f, 1.0f);
     
      // Set up the ambient light
        AmbientLight ambientLightNode = new AmbientLight(white);
        ambientLightNode.setInfluencingBounds(bounds);
        scene.addChild(ambientLightNode);
       
        // Set up the directional lights
        Vector3f light1Direction  = new Vector3f(60,30,15);
View Full Code Here

    //Shine it with two colored lights.
    Color3f lColor1 = new Color3f(.5f, .5f, .5f);
    Color3f lColor2 = new Color3f(1.0f, 1.0f, 1.0f);
    Vector3f lDir2  = new Vector3f(-1.0f, 0.0f, -1.0f);
    DirectionalLight lgt2 = new DirectionalLight(lColor2, lDir2);
    AmbientLight ambient = new AmbientLight(lColor1);
    lgt2.setInfluencingBounds(bounds);
    ambient.setInfluencingBounds(bounds);
    objRoot.addChild(lgt2);
    objRoot.addChild(ambient);
   
    // Let Java 3D perform optimizations on this scene graph.
    objRoot.compile();
View Full Code Here

/*    */   public AmbientLightState(SymbolTableData symbol, Controller control)
/*    */   {
/* 50 */     super(symbol, control);
/*    */   }
/*    */   protected SceneGraphObject createNode() {
/* 53 */     return new AmbientLight();
/*    */   }
View Full Code Here

/* 573 */     tokenizer.wordChars(126, 126);
/*     */   }
/*     */
/*     */   void addAmbient()
/*     */   {
/* 580 */     AmbientLight aLgt = new AmbientLight(this.ambientColor);
/* 581 */     BoundingSphere bounds = new BoundingSphere(new Point3d(0.0D, 0.0D, 0.0D), 100000.0D);
/*     */
/* 583 */     aLgt.setInfluencingBounds(bounds);
/* 584 */     this.sceneGroupNode.addChild(aLgt);
/*     */
/* 586 */     aLgt.addScope(this.sceneGroupNode);
/* 587 */     this.scene.addLightNode(aLgt);
/*     */   }
View Full Code Here

      // background
      Background background = new Background(0.4f,0.4f,0.8f);
      background.setApplicationBounds(boundingSphere);
      objRoot.addChild(background);
   
      AmbientLight alit = new AmbientLight(true,new Color3f(0.4f,0.4f,0.4f));
      objRoot.addChild(alit);
   
      objScale.addChild(objRot);
     
      return objRoot;
View Full Code Here

      Color3f lColor1 = new Color3f(0.5f, 0.0f, 0.5f);
      Color3f lColor2 = new Color3f(0.7f, 0.7f, 0.0f);
      Vector3f lDir1  = new Vector3f(-1.0f, -1.0f, 1.0f);
      Vector3f lDir2  = new Vector3f(0.0f, 0.0f, -1.0f);
     
      AmbientLight     lgt0 = new AmbientLight(true, lColor2);
      DirectionalLight lgt1 = new DirectionalLight(lColor1, lDir1);
      DirectionalLight lgt2 = new DirectionalLight(lColor2, lDir2);
      lgt0.setInfluencingBounds(bounds);
      lgt1.setInfluencingBounds(bounds);
      lgt2.setInfluencingBounds(bounds);
      objScale.addChild(lgt0);
      objScale.addChild(lgt1);
      objScale.addChild(lgt2);
View Full Code Here

    Vector3f light1Direction  = new Vector3f(4.0f, -7.0f, -12.0f);
    Color3f light2Color = new Color3f(0.3f, 0.3f, 0.4f);
    Vector3f light2Direction  = new Vector3f(-6.0f, -2.0f, -1.0f);
    Color3f ambientColor = new Color3f(0.1f, 0.1f, 0.1f);

    AmbientLight ambientLightNode = new AmbientLight(ambientColor);
    ambientLightNode.setInfluencingBounds(bounds);
    objScale.addChild(ambientLightNode);

    DirectionalLight light1
        = new DirectionalLight(light1Color, light1Direction);
    light1.setInfluencingBounds(bounds);
View Full Code Here

TOP

Related Classes of javax.media.j3d.AmbientLight

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.