Package javax.media.j3d

Examples of javax.media.j3d.AmbientLight


    scene.detach();
    objRoot.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
    objRoot.addChild(sphereTrans);

    AmbientLight aLgt = new AmbientLight(new Color3f(0.2f, 0.2f, 0.2f));
    objRoot.addChild(aLgt);
   
    scene.attach();
  }
View Full Code Here


        branchgroup.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
        branchgroup.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
       
        // TODO use light factories

        AmbientLight alight = new AmbientLight(true,new Color3f(0.5f,0.5f,0.5f));
        alight.setEnable(true);
        rootGroup.addChild(alight);
        BoundingSphere bounds = new BoundingSphere (new Point3d (0, 0.0, 0), 1E100);
        alight.setInfluencingBounds(bounds);

        lights = new DirectionalLight[1];

        for (int i=0; i<lights.length; ++i) {
          // TODO : position lights around the object
View Full Code Here

        branchgroup.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
        branchgroup.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
       
        // TODO use light factories

        AmbientLight alight = new AmbientLight(true,new Color3f(0.5f,0.5f,0.5f));
        alight.setEnable(true);
        rootGroup.addChild(alight);
        BoundingSphere bounds = new BoundingSphere (new Point3d (0, 0.0, 0), 1E100);
        alight.setInfluencingBounds(bounds);

        lights = new DirectionalLight[1];

        for (int i=0; i<lights.length; ++i) {
          // TODO : position lights around the object
View Full Code Here

        objRoot.addChild(objTrans);
        BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),
                100.0);
        // Set up the ambient light
        Color3f ambientColor = new Color3f(0.3f, 0.3f, 0.3f);
        AmbientLight ambientLightNode = new AmbientLight(ambientColor);
        ambientLightNode.setInfluencingBounds(bounds);
        objRoot.addChild(ambientLightNode);
        // Set up one directional lights
        Color3f light1Color = new Color3f(1.0f, 1.0f, 0.9f);
        Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f);
        DirectionalLight light1 = new DirectionalLight(light1Color,
View Full Code Here

    final Light [] lights = {
        new DirectionalLight(new Color3f(1, 1, 1), new Vector3f(1.5f, -0.8f, -1)),        
        new DirectionalLight(new Color3f(1, 1, 1), new Vector3f(-1.5f, -0.8f, -1)),
        new DirectionalLight(new Color3f(1, 1, 1), new Vector3f(0, -0.8f, 1)),
        new DirectionalLight(new Color3f(0.7f, 0.7f, 0.7f), new Vector3f(0, 1f, 0)),
        new AmbientLight(new Color3f(0.2f, 0.2f, 0.2f))};
    for (int i = 0; i < lights.length - 1; i++) {
      // Allow directional lights color to change
      lights [i].setCapability(DirectionalLight.ALLOW_COLOR_WRITE);
      // Store default color in user data
      Color3f defaultColor = new Color3f();
View Full Code Here

  private Light [] getLights() {
    Light [] lights = {
        new DirectionalLight(new Color3f(0.9f, 0.9f, 0.9f), new Vector3f(1.732f, -0.8f, -1)),
        new DirectionalLight(new Color3f(0.9f, 0.9f, 0.9f), new Vector3f(-1.732f, -0.8f, -1)),
        new DirectionalLight(new Color3f(0.9f, 0.9f, 0.9f), new Vector3f(0, -0.8f, 1)),
        new AmbientLight(new Color3f(0.2f, 0.2f, 0.2f))};

    for (Light light : lights) {
      light.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0), 100));
    }
    return lights;
View Full Code Here

                new Vector3f(-1, -0.5f, -2)
            );
            pl.setInfluencingBounds(bounds);
            addChild(pl);

            AmbientLight al = new AmbientLight(new Color3f(0.4f, 0.4f, 0.4f));
            al.setInfluencingBounds(bounds);
            addChild(al);
        } else {
            System.out.println("BoardModel: full update");
        }
View Full Code Here



    //Light no. 4: ambient light.
    Color3f lightColour4 = new Color3f(0.2f, 0.2f, 0.2f);
    AmbientLight light4 = new AmbientLight(lightColour4);
    light4.setInfluencingBounds(bounds);
    bgLight.addChild(light4);


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

    bgLight.addChild(light1);


    //Ambient light.
    Color3f lightColour2 = new Color3f(0.5f, 0.5f, 0.5f);
    AmbientLight light2 = new AmbientLight(lightColour2);
    light2.setInfluencingBounds(bounds);
    bgLight.addChild(light2);


    su.addBranchGraph(bgLight);
View Full Code Here

      tg2.setTransform(translation2);
      Box box = new Box();
      tg2.addChild(box);
      parent.addChild(tg2);
     
      AmbientLight light = new AmbientLight(new Color3f(0.5f, 0.5f, 0.5f));
      //light.setColor(new Color3f(0.5f, 0.5f, 0.5f));
      light.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0), 80));
      parent.addChild(light);
     
      soleil = new DirectionalLight();
      soleil.setDirection(new Vector3f(0.1f, 0.1f, -0.5f));
      //light.setColor(new Color3f(0.5f, 0.5f, 0.5f));
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.