Package javax.media.j3d

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


    cylMoveL.setSchedulingBounds(bounds);


    //Add the movements to the transformation group.
    tgmCyl.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgmCyl.addChild(cylMoveR);
    tgmCyl.addChild(cylMoveL);


    //A Switch for the green and the red sphere.
    Switch colourSwitch = new Switch();
View Full Code Here



    //Add the movements to the transformation group.
    tgmCyl.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgmCyl.addChild(cylMoveR);
    tgmCyl.addChild(cylMoveL);


    //A Switch for the green and the red sphere.
    Switch colourSwitch = new Switch();
    colourSwitch.setCapability(Switch.ALLOW_SWITCH_WRITE);
View Full Code Here

    //A transformation group for the Switch (the spheres).
    Transform3D tfSphere = new Transform3D();
    tfSphere.setTranslation(new Vector3f(0.7f,0.0f,0.0f));
    TransformGroup tgSphere = new TransformGroup(tfSphere);
    tgSphere.addChild(colourSwitch);



    //Generate the scenegraph.
    BranchGroup theScene = new BranchGroup();
View Full Code Here

    //everything must be collected in a separate transformation group to which
    //the KeyNavigatorBehavior is applied.
    TransformGroup tgAll = new TransformGroup();
    tgAll.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
    tgAll.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgAll.addChild(tgBox);
    tgAll.addChild(tgSphere);
    tgAll.addChild(tgmCyl);
    KeyNavigatorBehavior knb = new KeyNavigatorBehavior(tgAll);
    knb.setSchedulingBounds(bounds);
    tgAll.addChild(knb);
View Full Code Here

    //the KeyNavigatorBehavior is applied.
    TransformGroup tgAll = new TransformGroup();
    tgAll.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
    tgAll.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgAll.addChild(tgBox);
    tgAll.addChild(tgSphere);
    tgAll.addChild(tgmCyl);
    KeyNavigatorBehavior knb = new KeyNavigatorBehavior(tgAll);
    knb.setSchedulingBounds(bounds);
    tgAll.addChild(knb);
    theScene.addChild(tgAll);
View Full Code Here

    TransformGroup tgAll = new TransformGroup();
    tgAll.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
    tgAll.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    tgAll.addChild(tgBox);
    tgAll.addChild(tgSphere);
    tgAll.addChild(tgmCyl);
    KeyNavigatorBehavior knb = new KeyNavigatorBehavior(tgAll);
    knb.setSchedulingBounds(bounds);
    tgAll.addChild(knb);
    theScene.addChild(tgAll);
View Full Code Here

    tgAll.addChild(tgBox);
    tgAll.addChild(tgSphere);
    tgAll.addChild(tgmCyl);
    KeyNavigatorBehavior knb = new KeyNavigatorBehavior(tgAll);
    knb.setSchedulingBounds(bounds);
    tgAll.addChild(knb);
    theScene.addChild(tgAll);

    //The PickTranslateBehavior for moving the blue cube.
    PickTranslateBehavior pickTrans = new PickTranslateBehavior(theScene,myCanvas3D,bounds);
    theScene.addChild(pickTrans);
View Full Code Here

    Transform3D xRotation = new Transform3D();
    xRotation.rotY(0.4*Math.PI);
    tfObject.mul(xRotation);
    TransformGroup tgObject = new TransformGroup(tfObject);

    tgObject.addChild(extractedObject);

    BranchGroup theScene = new BranchGroup();

    //Add the transformation group with the blue part to the scene.
    theScene.addChild(tgObject);
View Full Code Here

    tfBox.rotX(Math.PI/9);
    Transform3D shift = new Transform3D();
    shift.setTranslation(new Vector3f(-0.6f,-0.2f,0.1f));
    tfBox.mul(shift);
    TransformGroup tgBox = new TransformGroup(tfBox);
    tgBox.addChild(myBox);




//***Generate a sphere ***
 
View Full Code Here

    Sphere mySphere = new Sphere(0.3f,Sphere.GENERATE_NORMALS,100,sphereApp);
    Transform3D tfSphere = new Transform3D();
    tfSphere.setTranslation(new Vector3f(0.0f,0.0f,-1.0f));

    TransformGroup tgSphere = new TransformGroup(tfSphere);
    tgSphere.addChild(mySphere);




    //*** Generate (the root of) the scenegraph. ***
 
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.