Refine search
scene.compile(); BranchGroup lineGroup = new BranchGroup(); Appearance app = new Appearance(); ColoringAttributes ca = new ColoringAttributes(new Color3f(204.0f, 204.0f, 204.0f), ColoringAttributes.SHADE_FLAT); pla.setCoordinates(0, plaPts); Shape3D plShape = new Shape3D(pla, app); TransformGroup objRotate = new TransformGroup(); objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate.addChild(plShape); lineGroup.addChild(objRotate); return lineGroup;
final BranchGroup bg1 = new BranchGroup(); bg1.setCapability( BranchGroup.ALLOW_DETACH ); bg1.addChild( node ); spotSwitch.addChild( bg1 ); textShape.setAppearance( textAp ); final Transform3D translation = new Transform3D(); translation.rotX( Math.PI ); translation.setTranslation( new Vector3d( center.x + 1.5f * center.w, center.y, center.z ) ); final TransformGroup tg = new TransformGroup( translation ); tg.addChild( textShape ); final BranchGroup bg2 = new BranchGroup(); bg2.setCapability( BranchGroup.ALLOW_DETACH ); bg2.addChild( tg ); textSwitch.addChild( bg2 );
SimpleUniverse simpleUniverse = new SimpleUniverse(canvas); BranchGroup rootBranchGroup = new BranchGroup(); createContents(rootBranchGroup); Transform3D viewPlatformTransform = new Transform3D(); Transform3D t0 = new Transform3D(); t0.setTranslation(new Vector3d(0,0,10)); Transform3D t1 = new Transform3D(); t1.rotX(Math.toRadians(-30)); int rotationTimeMs, boolean forward) TransformGroup rotationTransformGroup = new TransformGroup(); rotationTransformGroup.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE); double dx, double dy, double dz) TransformGroup translationTransformGroup = new TransformGroup(); Transform3D translationTransform = new Transform3D(); translationTransform.setTranslation( TransformGroup translationTransformGroup = createTranslatingTransformGroup(distanceFromCenter, 0, 0); orbitTransformGroup.addChild(translationTransformGroup);
v3f.z = p.z; final BranchGroup bg = new BranchGroup(); bg.setName(name); bg.setCapability(BranchGroup.ALLOW_DETACH); t3d.set(v3f); final TransformGroup tg = new TransformGroup(t3d); tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); bg.addChild(tg); final TransformGroup sig = new TransformGroup(); sig.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); tg.addChild(sig); final Transform3D scaleTransform = new Transform3D(); sig.getTransform(scaleTransform); scaleTransform.setScale(radius); sig.setTransform(scaleTransform);
BranchGroup group = new BranchGroup(); group.addChild(createModel()); universe.getViewingPlatform().setNominalViewingTransform(); universe.addBranchGraph(group); Transform3D transform = new Transform3D(); Transform3D translate1 = new Transform3D(); translate1.setTranslation(new Vector3d(0.0, -radius, 0.0)); transform.mul(translate1, transform); transform.mul(translate2, transform); TransformGroup tg = new TransformGroup(); tg.setTransform(transform); tg.addChild(cube); return tg;
public BranchGroup createSceneGraph() { BranchGroup objRoot = new BranchGroup(); Transform3D rotate = new Transform3D(); Transform3D tempRotate = new Transform3D(); rotate.rotX(Math.PI/4.0d); tempRotate.rotY(Math.PI/5.0d); rotate.mul(tempRotate); TransformGroup objRotate = new TransformGroup(rotate); TransformGroup objSpin = new TransformGroup(); objSpin.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRoot.addChild(objRotate); objRotate.addChild(objSpin);
public void addVertex(Image3DUniverse univ, Color3f color, float x, float y, float z) { BranchGroup bg = new BranchGroup(); bg.setCapability(BranchGroup.ALLOW_DETACH); TransformGroup tg = new TransformGroup(); Transform3D t3d = new Transform3D(); t3d.setTranslation(new Vector3f(x, y, z)); tg.setTransform(t3d); bg.addChild(tg); Appearance app = new Appearance(); ColoringAttributes cattr = new ColoringAttributes(); cattr.setColor(color); app.setColoringAttributes(cattr); tg.addChild(new Sphere(0.1f, app)); univ.getScene().addChild(bg); }
TransformGroup tg2 = new TransformGroup (); //set the appearance of the product boxes (transparent) Appearance app = new Appearance(); app.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.BLENDED,0.2f)); //create a box having length = l, breadth = b and height = h Box box = new Box( (float )item[p].getLength(), (float) item[p].getBreadth(), (float) item[p].getHeight(), app); // vector to translate the item box to the position (x, y, z) Vector3f position = new Vector3f((float) x, (float) y, (float) z); //creation of a 3D transform group Transform3D transform = new Transform3D(); transform.setTranslation(position); tg2.setTransform(transform); //add new item box to the transform group tg2.addChild(box); tg2.setCapability(Group.ALLOW_CHILDREN_EXTEND); BranchGroup scene = new BranchGroup(); scene.addChild(tg2); scene1.addChild(scene);
add("Center", c); BranchGroup group = new BranchGroup(); group.addChild(createSomeCube()); group.addChild(background); Transform3D t = new Transform3D(); t.rotY(0.2); t.setScale(0.1); TransformGroup tg = new TransformGroup(); tg.setTransform(t); tg.removeAllChildren(); tg.addChild(cube); return tg;
frontShape.setCapability(Shape3D.ALLOW_APPEARANCE_READ); final BranchGroup frontShapeGroup = new BranchGroup(); frontShapeGroup.setCapability(BranchGroup.ALLOW_DETACH); frontShapeGroup.setCapability(Group.ALLOW_CHILDREN_READ); frontShapeGroup.addChild(frontShape); front.addChild(frontShapeGroup); backShape.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE); final BranchGroup backShapeGroup = new BranchGroup(); backShapeGroup.setCapability(BranchGroup.ALLOW_DETACH); backShapeGroup.setCapability(Group.ALLOW_CHILDREN_READ); backShapeGroup.addChild(backShape); back.insertChild(backShapeGroup, 0);
BranchGroup bg = new BranchGroup(); root.addChild(bg); ... bg.addChild(ob1); ... bg.addChild(tg); bg.addChild(tg1);
echoBranchGroup = new BranchGroup() ; echoBranchGroup.setCapability (BranchGroup.ALLOW_DETACH) ; echoBranchGroup.setCapability (BranchGroup.ALLOW_CHILDREN_READ) ; echoBranchGroup.setCapability (BranchGroup.ALLOW_CHILDREN_WRITE) ; echoBranchGroup.addChild(echoTransformGroup) ; echoBranchGroup.compile() ;
BranchGroup bg = new BranchGroup(); bg.addChild(shape); u.addBranchGraph(bg); Transform3D t3d = new Transform3D(); t3d.lookAt(from, to, v); t3d.invert(); viewTransform.setTransform(t3d);
scene1 = new BranchGroup(); Transform3D rotateCube = new Transform3D(); rotateCube.set(new AxisAngle4d(1.0, 1.0, 0.0, Math.PI /4.0)); tg1.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); tg1.addChild(container);
/** * Set the radius of the points. * * @param r */ public void setRadius(final float r) { this.radius = r; final Transform3D t3d = new Transform3D(); for (int i = 0; i < numChildren(); i++) { final BranchGroup bg = (BranchGroup) getChild(i); final TransformGroup tg = (TransformGroup) bg.getChild(0); final ScaleInterpolator si = (ScaleInterpolator) tg.getChild(1); if (si != null) { si.setMaximumScale(5 * radius); si.setMinimumScale(radius); } final TransformGroup sig = (TransformGroup) tg.getChild(0); sig.getTransform(t3d); t3d.setScale(radius); sig.setTransform(t3d); } }
BranchGroup scene = new BranchGroup(); scene.addChild(new ColorCube(0.4)); scene.compile(); simpleU.addBranchGraph(scene);
BranchGroup group = new BranchGroup(); Transform3D transform= new Transform3D(); Vector3d vector = new Vector3d(-0.5, 0.0, 0.4); Transform3D transform = new Transform3D(); transformGroup.addChild(cube); group.addChild(transformGroup);
content.compile(); BranchGroup group = new BranchGroup(); group.addChild(new ColorCube(.5)); Transform3D move = new Transform3D(); Vector3d up = new Vector3d(point.x, point.y + 1, point.z); move.lookAt(point, new Point3d(0.0d, 0.0d, 0.0d), up);
/** * Creates a PickMouseBehavior given current canvas, root of the tree to * operate on, and the bounds. */ public PickMouseBehavior(Canvas3D canvas, BranchGroup root, Bounds bounds){ super(); currGrp = new TransformGroup(); currGrp.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); currGrp.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); root.addChild(currGrp); pickScene = new PickObject(canvas, root); }
/** * @deprecated This method should not be used any more from outside this * class. Use addInteractiveBehavior() instead. */ @Deprecated public void setInteractiveBehavior(final InteractiveBehavior b) { if (mouseBehavior != null) scene.removeChild(mouseBehavior.getParent()); mouseBehavior = b; mouseBehavior.setSchedulingBounds(bounds); final BranchGroup bg = new BranchGroup(); bg.setCapability(BranchGroup.ALLOW_DETACH); bg.addChild(mouseBehavior); scene.addChild(bg); }