Package javax.media.j3d

Examples of javax.media.j3d.BranchGroup.addChild()


    //Light no. 1: directional light.
    Color3f lightColour1 = new Color3f(0.8f, 0.8f, 0.8f);
    Vector3f lightDir1  = new Vector3f(0.0f, 4.0f, -1.0f);
    DirectionalLight light1 = new DirectionalLight(lightColour1, lightDir1);
    light1.setInfluencingBounds(bounds);
    bgLight.addChild(light1);



    //Light no. 2: a point light.
    Color3f lightColour2 = new Color3f(0.3f, 0.3f, 0.3f);
View Full Code Here


                                     new Vector3f(0.0f,0.0f,-1.0f),
                                     (float) (Math.PI/20),
                                     0.0f);

    light3.setInfluencingBounds(bounds);
    bgLight.addChild(light3);



    //Light no. 4: ambient light.
    Color3f lightColour4 = new Color3f(0.2f, 0.2f, 0.2f);
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

        Shape3D partOfTheObject = (Shape3D) namedObjects.get("flugdeck");
        partOfTheObject.setAppearance(lightBlueApp);

        BranchGroup theScene = new BranchGroup();

        theScene.addChild(tgObject);

        // The following four lines generate a white background.
        Background bg = new Background(new Color3f(1.0f, 1.0f, 1.0f));
        BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),
                Double.MAX_VALUE);
View Full Code Here

        // The following four lines generate a white background.
        Background bg = new Background(new Color3f(1.0f, 1.0f, 1.0f));
        BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),
                Double.MAX_VALUE);
        bg.setApplicationBounds(bounds);
        theScene.addChild(bg);

        theScene.compile();

        // Add the scene to the universe.
        su.addBranchGraph(theScene);
View Full Code Here

        Color3f lightColour1 = new Color3f(1.0f, 1.0f, 1.0f);
        Vector3f lightDir1 = new Vector3f(-1.0f, 0.0f, -0.5f);
        DirectionalLight light1 = new DirectionalLight(lightColour1, lightDir1);
        light1.setInfluencingBounds(bounds);

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



    //Add everything to the scene.
    BranchGroup theScene = new BranchGroup();;
    theScene.addChild(tg1);
    theScene.addChild(tg2);


    //Generate a white background.
    Background bg = new Background(new Color3f(1.0f,1.0f,1.0f));
View Full Code Here


    //Add everything to the scene.
    BranchGroup theScene = new BranchGroup();;
    theScene.addChild(tg1);
    theScene.addChild(tg2);


    //Generate a white background.
    Background bg = new Background(new Color3f(1.0f,1.0f,1.0f));
    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE);
View Full Code Here

    //Generate a white background.
    Background bg = new Background(new Color3f(1.0f,1.0f,1.0f));
    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0),Double.MAX_VALUE);
    bg.setApplicationBounds(bounds);
    theScene.addChild(bg);


    theScene.compile();

    //Add the scene to the universe.
View Full Code Here

    Color3f lightColour1 = new Color3f(1.0f,1.0f,1.0f);
    Vector3f lightDir1  = new Vector3f(0.0f,0.0f,-0.1f);
    DirectionalLight light1 = new DirectionalLight(lightColour1, lightDir1);
    light1.setInfluencingBounds(bounds);

    bgLight.addChild(light1);


    //Ambient light.
    Color3f lightColour2 = new Color3f(0.5f, 0.5f, 0.5f);
    AmbientLight light2 = new AmbientLight(lightColour2);
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.