Package javax.media.j3d

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


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

        // In the following way, the names of the parts of the object can be
        // obtained. The names are printed.
        Hashtable namedObjects = s.getNamedObjects();
        Enumeration enumer = namedObjects.keys();
View Full Code Here


    rotationX.rotX(-Math.PI/5);
    tfFBox1.mul(rotationX);

    //The transformation group for the cube.
    TransformGroup tgFBox1 = new TransformGroup(tfFBox1);
    tgFBox1.addChild(fBox1);



    //Generate a nontransparent Appearance for the spheres.
    Color3f ambientColourBSphere = new Color3f(0.0f,0.7f,0.0f);
View Full Code Here

    Sphere bSphere1 = new Sphere(radius,bSphereApp);

    Transform3D tfBSphere1 = new Transform3D();
    tfBSphere1.setTranslation(new Vector3f(xShiftSphere,sphereLift,sphereBackShift));
    TransformGroup tgBSphere1 = new TransformGroup(tfBSphere1);
    tgBSphere1.addChild(bSphere1);


    //The left cube and the left sphere are combined in one transformation group
    //in order to position them jointly.
    Transform3D tf1 = new Transform3D();
View Full Code Here

    //The left cube and the left sphere are combined in one transformation group
    //in order to position them jointly.
    Transform3D tf1 = new Transform3D();
    tf1.setTranslation(new Vector3f(-xShift,0.0f,0.0f));
    TransformGroup tg1 = new TransformGroup(tf1);
    tg1.addChild(tgFBox1);
    tg1.addChild(tgBSphere1);


    //The right cube with sreen door transparency.
    Appearance fBoxApp2 = new Appearance();
View Full Code Here

    //in order to position them jointly.
    Transform3D tf1 = new Transform3D();
    tf1.setTranslation(new Vector3f(-xShift,0.0f,0.0f));
    TransformGroup tg1 = new TransformGroup(tf1);
    tg1.addChild(tgFBox1);
    tg1.addChild(tgBSphere1);


    //The right cube with sreen door transparency.
    Appearance fBoxApp2 = new Appearance();
    fBoxApp2.setMaterial(new Material(ambientColourFBox,emissiveColourFBox,
View Full Code Here

    Transform3D tfFBox2 = new Transform3D();
    tfFBox2.mul(rotationX);
    TransformGroup tgFBox2 = new TransformGroup(tfFBox2);

    //The transformation group for the right cube.
    tgFBox2.addChild(fBox2);


    //The right sphere and its transformation group.
    Sphere bSphere2 = new Sphere(radius,bSphereApp);
    Transform3D tfBSphere2 = new Transform3D();
View Full Code Here

    //The right sphere and its transformation group.
    Sphere bSphere2 = new Sphere(radius,bSphereApp);
    Transform3D tfBSphere2 = new Transform3D();
    tfBSphere2.setTranslation(new Vector3f(-xShiftSphere,sphereLift,sphereBackShift));
    TransformGroup tgBSphere2 = new TransformGroup(tfBSphere2);
    tgBSphere2.addChild(bSphere2);



    //The right cube and the right sphere are combined in one transformation group
    //in order to position them jointly.
View Full Code Here

    //The right cube and the right sphere are combined in one transformation group
    //in order to position them jointly.
    Transform3D tf2 = new Transform3D();
    tf2.setTranslation(new Vector3f(xShift,0.0f,0.0f));
    TransformGroup tg2 = new TransformGroup(tf2);
    tg2.addChild(tgFBox2);
    tg2.addChild(tgBSphere2);



View Full Code Here

    //in order to position them jointly.
    Transform3D tf2 = new Transform3D();
    tf2.setTranslation(new Vector3f(xShift,0.0f,0.0f));
    TransformGroup tg2 = new TransformGroup(tf2);
    tg2.addChild(tgFBox2);
    tg2.addChild(tgBSphere2);




    //Add everything to the scene.
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

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.