Package javax.media.j3d

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


    tfHeliPlat.setTranslation(new Vector3f(0.0f,0.1f,0.0f));

    //The transformation group for the helicopter together with the platform.
    TransformGroup tgHeliPlat = new TransformGroup(tfHeliPlat);
    tgHeliPlat.addChild(tgHelicopter);
    tgHeliPlat.addChild(tgPlatform);



//*** The tree trunk. ***

 
View Full Code Here


    //The transformation group of the tree trunk. The tree trunk first
    //remains in the origin and is placed in the scene together with the
    //leaves.
    TransformGroup tgTrunk = new TransformGroup();
    tgTrunk.addChild(trunk);


//*** The treetop. ***

    //Height of the treetop.
View Full Code Here

    Transform3D tfLeaves = new Transform3D();
    tfLeaves.setTranslation(new Vector3f(0.0f,(trunkHeight+leavesHeight)/2,0.0f));

    //The transformation group of the treetop.
    TransformGroup tgLeaves = new TransformGroup(tfLeaves);
    tgLeaves.addChild(leaves);


//*** The tree assembled from the transformation groups for     ***
//*** the tree trunk and the treetop.                           ***

 
View Full Code Here

    Transform3D tfTree = new Transform3D();
    tfTree.setTranslation(new Vector3f(-0.6f,0.0f,0.0f));

    //The transformation group of the tree.
    TransformGroup tgTree = new TransformGroup(tfTree);
    tgTree.addChild(tgTrunk);
    tgTree.addChild(tgLeaves);


//*** The root of the graph containing the scene. ***
    BranchGroup theScene = new BranchGroup();
View Full Code Here

    tfTree.setTranslation(new Vector3f(-0.6f,0.0f,0.0f));

    //The transformation group of the tree.
    TransformGroup tgTree = new TransformGroup(tfTree);
    tgTree.addChild(tgTrunk);
    tgTree.addChild(tgLeaves);


//*** The root of the graph containing the scene. ***
    BranchGroup theScene = new BranchGroup();

View Full Code Here

    //A sphere to which Appearance, i.e. the texture is assigned.
    Sphere tSphere = new Sphere(0.5f,Sphere.GENERATE_NORMALS,100,textureApp);

    //The transformation group for the sphere.
    TransformGroup tgSphere = new TransformGroup();
    tgSphere.addChild(tSphere);

    //Add everything to the scene.
    BranchGroup theScene = new BranchGroup();
    theScene.addChild(tgSphere);
View Full Code Here

    Transform3D tfPlatform = new Transform3D();
    tfPlatform.rotY(Math.PI/6);

    //The transformation group of the platform.
    TransformGroup tgPlatform = new TransformGroup(tfPlatform);
    tgPlatform.addChild(platform);




View Full Code Here

    //The transformation group for the cockpit.
    //The cockpit first remains in the origin. Later on, the whole
    //helicopter is shifted onto the platform.
    TransformGroup tgCabin = new TransformGroup();
    tgCabin.addChild(cabin);


//*** The rotor blade of the helicopter. ***

    //An Appearance to make the rotor blade blue.
View Full Code Here

    Transform3D tfRotor = new Transform3D();
    tfRotor.setTranslation(new Vector3f(0.0f,cabinRadius,0.0f));

    //The transformation group for the rotor blade.
    TransformGroup tgRotor = new TransformGroup(tfRotor);
    tgRotor.addChild(rotor);


//*** The tail of the helicopter. ***

    //Length of the tail.
View Full Code Here

    Transform3D tfTail = new Transform3D();
    tfTail.setTranslation(new Vector3f(cabinRadius+halfTailLength,0.0f,0.0f));

    //The transformation group for the tail.
    TransformGroup tgTail = new TransformGroup(tfTail);
    tgTail.addChild(tail);



//*** The helicopter, assembled by the transformation groups  ***
//*** for the cockpit, the rotor blade and the tail.          ***
 
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.