ColorCube cube = new ColorCube(0.75); objRot.addChild(cube);
Font3D f3d = new Font3D(new Font("dialog", Font.PLAIN, 1), new FontExtrusion()); Text3D text = new Text3D(f3d, "JCanvas3D", new Point3f( -2.3f, -0.5f, 0.f));  Shape3D sh = new Shape3D(); Appearance app = new Appearance(); Material mm = new Material(); mm.setLightingEnable(true); app.setMaterial(mm); sh.setGeometry(text); sh.setAppearance(app);  objRot.addChild( sh );
    private BranchGroup createSceneGraph(boolean isInteractive, boolean isRandom) {        // Create the root of the branch graph        BranchGroup objRoot = new BranchGroup();        // Create the TransformGroup node and initialize it to the        // identity. Enable the TRANSFORM_WRITE capability so that        // our behavior code can modify it at run time. Add it to        // the root of the subgraph.        TransformGroup objTrans = new TransformGroup();        Transform3D t3dTrans = new Transform3D();        t3dTrans.setTranslation(new Vector3d(0, 0, -1));        objTrans.setTransform(t3dTrans);        TransformGroup objRot = new TransformGroup();        objRot.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);        objRoot.addChild(objTrans);        objTrans.addChild(objRot);        // Create a simple Shape3D node; add it to the scene graph.        ColorCube cube = new ColorCube(0.75);        objRot.addChild(cube);        BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0),                100.0);        if (true == isInteractive) {            MouseRotate mr = new MouseRotate(comp, objRot);            mr.setSchedulingBounds(bounds);            mr.setSchedulingInterval(1);            objRoot.addChild(mr);        } else {            // Create a new Behavior object that will perform the            // desired operation on the specified transform and add            // it into the scene graph.            Transform3D yAxis = new Transform3D();            // rotation speed is randomized a bit so that it does not go at the same speed on every canvases,            // which will make it more natural and express the differences between every present universes            Alpha rotationAlpha = null;            if (true == isRandom) {                int duration = Math.max(2000, (int) (Math.random() * 8000.));                rotationAlpha = new Alpha(-1,                        (int) ((double) duration * Math.random()), 0, duration,                        0, 0);            } else {                rotationAlpha = new Alpha(-1, 4000);            }            RotationInterpolator rotator = new RotationInterpolator(rotationAlpha,                    objRot, yAxis, 0.0f, (float) Math.PI * 2.0f);            rotator.setSchedulingBounds(bounds);            objRoot.addChild(rotator);        }        return objRoot;    }