objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate.addChild(plShape); lineGroup.addChild(objRotate); return lineGroup;
objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate.addChild(plShape); lineGroup.addChild(objRotate); return lineGroup;
objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate.addChild(plShape); lineGroup.addChild(objRotate); return lineGroup;
mr.setTransformGroup(objRotate); mr.setSchedulingBounds(new BoundingSphere()); lineGroup.addChild(mr); MouseZoom mz=new MouseZoom(); mz.setTransformGroup(objRotate); mz.setSchedulingBounds(new BoundingSphere()); lineGroup.addChild(mz); MouseTranslate msl=new MouseTranslate(); msl.setTransformGroup(objRotate); msl.setSchedulingBounds(new BoundingSphere()); lineGroup.addChild(msl); al.setColor(new Color3f(1,1,1)); lineGroup.addChild(objRotate); lineGroup.addChild(al); return lineGroup;
/** * Add appropriate fog effects to the scene */ void addFog() { if (fog != null) { Fog fogNode = fog.getObjectNode(); if (fogNode != null) { sceneGroupNode.addChild(fogNode); scene.addFogNode(fogNode); } } }
/** * @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); }
public CustomMultiMesh(final CustomMesh customMesh) { setCapabilities(this); customMeshes = new ArrayList<CustomMesh>(); customMeshes.add(customMesh); calculateMinMaxCenterPoint(); final BranchGroup bg = new BranchGroup(); setCapabilities(bg); bg.addChild(customMesh); addChild(bg); }
public void add(final CustomMesh mesh) { customMeshes.add(mesh); calculateMinMaxCenterPoint(); final BranchGroup bg = new BranchGroup(); setCapabilities(bg); bg.addChild(mesh); addChild(bg); }
public CustomMultiMesh(final List<CustomMesh> meshes) { customMeshes = meshes; calculateMinMaxCenterPoint(); for (final CustomMesh m : customMeshes) { final BranchGroup bg = new BranchGroup(); setCapabilities(bg); bg.addChild(m); addChild(bg); } }
/** * 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); }
/** * 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); pickCanvas = new PickCanvas(canvas, root); }
/** * 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); pickCanvas = new PickCanvas(canvas, root); }
public ShapeGroup duplicate() { final ShapeGroup ret = new ShapeGroup(); if (shape != null) { ret.shape = new Shape3D(shape.getGeometry(), shape.getAppearance()); ret.group.addChild(ret.shape); } ret.pos = pos; return ret; } }
BranchGroup group = new BranchGroup(); //Content branch. PolygonAttributes p = new PolygonAttributes(); //Not sure how to make it transparent/try code above. Appearance planeAppearance = new Appearance(); planeAppearance.setPolygonAttributes (p); Color3f planeColor = new Color3f (1.0f, 1.0f, 1.0f); //This makes it white. ColoringAttributes planeCA = new ColoringAttributes (planeColor, 1); planeAppearance.setColoringAttributes(planeCA); QuadArray plane = new QuadArray (4, QuadArray.COORDINATES); //This makes the plane. plane.setCoordinate(0, new Point3f(-5f, -5f, -15f)); //You specify your own cornerpoints... plane.setCoordinate(1, new Point3f(5f, -5f, -15f)); plane.setCoordinate(2, new Point3f(5f, 5f, -15f)); plane.setCoordinate(3, new Point3f(-5f, 5f, -15f)); group.addChild(new Shape3D(plane, planeAppearance)); //Add plane to content branch.
/** * Adds Ambient lighting effects to the scene */ void addAmbient() { AmbientLight aLgt = new AmbientLight(ambientColor); BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100000.0); aLgt.setInfluencingBounds(bounds); sceneGroupNode.addChild(aLgt); // scope ambient light to the lw3d scene aLgt.addScope(sceneGroupNode); scene.addLightNode(aLgt); }