Package javax.media.j3d

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


    TransformGroup sphereTrans = new TransformGroup();
    sphereTrans.addChild(new Sphere(1.f, Sphere.GENERATE_NORMALS,40, a));

    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


    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

        // the root of the subgraph.
        TransformGroup objTrans = new TransformGroup();
        Transform3D t3dTrans = new Transform3D();
        objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        objTrans.setTransform(t3dTrans);
        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);
View Full Code Here

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

        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,
                light1Direction);
        light1.setInfluencingBounds(bounds);
        objRoot.addChild(light1);
        return objRoot;
    }

    public UniversePool() {
        _list = new ArrayList<PoolEntry>();
View Full Code Here

  private BranchGroup createSceneTree(boolean displayShadowOnFloor,
                                      boolean listenToHomeUpdates,
                                      boolean waitForLoading) {
    BranchGroup root = new BranchGroup();
    // Build scene tree
    root.addChild(createHomeTree(displayShadowOnFloor, listenToHomeUpdates, waitForLoading));
    root.addChild(createBackgroundNode(listenToHomeUpdates, waitForLoading));
    root.addChild(createGroundNode(-1E5f / 2, -1E5f / 2, 1E5f, 1E5f, listenToHomeUpdates, waitForLoading));

    // Add default lights
    for (Light light : createLights(listenToHomeUpdates)) {
View Full Code Here

                                      boolean listenToHomeUpdates,
                                      boolean waitForLoading) {
    BranchGroup root = new BranchGroup();
    // Build scene tree
    root.addChild(createHomeTree(displayShadowOnFloor, listenToHomeUpdates, waitForLoading));
    root.addChild(createBackgroundNode(listenToHomeUpdates, waitForLoading));
    root.addChild(createGroundNode(-1E5f / 2, -1E5f / 2, 1E5f, 1E5f, listenToHomeUpdates, waitForLoading));

    // Add default lights
    for (Light light : createLights(listenToHomeUpdates)) {
      root.addChild(light);
View Full Code Here

                                      boolean waitForLoading) {
    BranchGroup root = new BranchGroup();
    // Build scene tree
    root.addChild(createHomeTree(displayShadowOnFloor, listenToHomeUpdates, waitForLoading));
    root.addChild(createBackgroundNode(listenToHomeUpdates, waitForLoading));
    root.addChild(createGroundNode(-1E5f / 2, -1E5f / 2, 1E5f, 1E5f, listenToHomeUpdates, waitForLoading));

    // Add default lights
    for (Light light : createLights(listenToHomeUpdates)) {
      root.addChild(light);
    }
View Full Code Here

    root.addChild(createBackgroundNode(listenToHomeUpdates, waitForLoading));
    root.addChild(createGroundNode(-1E5f / 2, -1E5f / 2, 1E5f, 1E5f, listenToHomeUpdates, waitForLoading));

    // Add default lights
    for (Light light : createLights(listenToHomeUpdates)) {
      root.addChild(light);
    }
   
    return root;
  }
View Full Code Here

    backgroundColoringAttributes.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE);
   
    Geometry halfSphereGeometry = createHalfSphereGeometry();  
    final Shape3D halfSphere = new Shape3D(halfSphereGeometry, backgroundAppearance);
    BranchGroup backgroundBranch = new BranchGroup();
    backgroundBranch.addChild(halfSphere);
   
    final Background background = new Background(backgroundBranch);
    updateBackgroundColorAndTexture(backgroundAppearance, this.home, waitForLoading);
    background.setImageScaleMode(Background.SCALE_FIT_ALL);
    background.setApplicationBounds(new BoundingBox(
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.