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); AmbientLight al=new AmbientLight(); al.setBounds(new BoundingSphere()); al.setEnable(true); al.setColor(new Color3f(1,1,1));
objRotate.addChild(light2); MouseRotate f1=new MouseRotate(); f1.setSchedulingBounds(new BoundingSphere()); f1.setTransformGroup(objRotate); lineGroup.addChild(f1);
objRotate.addChild(light2); MouseRotate f1=new MouseRotate(); f1.setSchedulingBounds(new BoundingSphere()); f1.setTransformGroup(objRotate); lineGroup.addChild(f1);
/** * Creates a copy of the bounding sphere. * @return a BoundingSphere */ @Override public Object clone() { return new BoundingSphere(this.center, this.radius); }
OrbitBehavior orbit = new OrbitBehavior(canvas, OrbitBehavior.REVERSE_ROTATE); orbit.setSchedulingBounds(new BoundingSphere()); universe.getViewingPlatform().setViewPlatformBehavior(orbit);
GroupRetained() { this.nodeType = NodeRetained.GROUP; // issue 544 if (VirtualUniverse.mc.useBoxForGroupBounds) { localBounds = new BoundingBox((Bounds) null); } else { localBounds = new BoundingSphere((Bounds)null); } }
/** * Processes the built-in command (BoundingSphere center radius). * This is used when configuring behaviors. * * @param elements ArrayList containing Point3d at index 1 for the sphere * center and Double at index 2 wrapping the sphere radius, or the String * "infinite" at index 2. * * @return BoundingSphere with the given center and radius */ private BoundingSphere makeBoundingSphere(ArrayList elements) { if (elements.size() != 3) { throw new IllegalArgumentException ("Incorrect number of arguments to BoundingSphere") ; } if (! (elements.get(1) instanceof Point3d) || ! (elements.get(2) instanceof Double || elements.get(2) instanceof String)) throw new IllegalArgumentException ("BoundingSphere needs a Point3d center " + "followed by a Double radius or the String \"infinite\"") ; double r ; if (elements.get(2) instanceof Double) r = ((Double)elements.get(2)).doubleValue() ; else r = Double.POSITIVE_INFINITY ; return new BoundingSphere((Point3d)elements.get(1), r) ; }
boundingObject = new BoundingBox((Bounds) null); } else { boundingObject = new BoundingSphere((Bounds)null);
/** * Gets the bounding object of a node. * @return the node's bounding object */ @Override Bounds getBounds() { if ( boundsAutoCompute) { // Issue 514 : NPE in Wonderland : triggered in cached bounds computation if (validCachedBounds) { return (Bounds) cachedBounds.clone(); } // issue 544 Bounds boundingObject = null; if (VirtualUniverse.mc.useBoxForGroupBounds) { boundingObject = new BoundingBox((Bounds) null); } else { boundingObject = new BoundingSphere((Bounds)null); } for (int i = children.size() - 1; i >= 0; i--) { NodeRetained child = children.get(i); if (child != null) { child.computeCombineBounds(boundingObject); } } return boundingObject; } return super.getBounds(); }
/** * Parameterless constructor for this behavior. This is called when this * behavior is instantiated from a configuration file. * <p> * <b>Syntax:</b><br>(NewViewPlatformBehavior <i><name></i> * org.scijava.java3d.utils.behaviors.vp.WandViewBehavior) */ public WandViewBehavior() { // Create an event agent. eventAgent = new SensorEventAgent(this) ; // Set a default SchedulingBounds. setSchedulingBounds(new BoundingSphere(new Point3d(0.0, 0.0, 0.0), Double.POSITIVE_INFINITY)) ; }
public Bounds readBounds( DataInput in ) throws IOException { Bounds bounds; switch( in.readInt() ) { case 0: bounds = null; break; case 1: bounds = new BoundingBox( readPoint3d(in), readPoint3d(in) ); break; case 2: bounds = new BoundingSphere( readPoint3d(in), in.readDouble() ); break; case 3: Vector4d[] planes = new Vector4d[ in.readInt() ]; for(int i=0; i<planes.length; i++) planes[i] = readVector4d( in ); bounds = new BoundingPolytope(planes); break; default: throw new SGIORuntimeException("Unrecognised bounds class"); } return bounds; }
/** * Creates Java3d Fog object given the fog parameters in the file. * Note that various fog parameters in lw3d are not currently handled. */ void createJava3dObject() { // TODO: there are various attributes of lw fog that // we're not currently handing, including non-linear fog // (need to understand the two different types - these may // map onto java3d's expontential fog node), non-solid // backdrop colors (how to handle this?), min/max amount // (j3d only handles 0 -> 1 case) fogObject = new LinearFog(color, minDist, maxDist); debugOutputLn(VALUES, "just set linearFog with color, minDist, maxDist = " + color + ", " + minDist + ", " + maxDist); BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100000.0); fogObject.setInfluencingBounds(bounds); }
/** * 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); }
boundingObject = new BoundingBox((Bounds) null); } else { boundingObject = new BoundingSphere((Bounds)null);
/** * Creates Java3d objects from the background data. Note that there * are plenty of lw3d background attributes that the loader currently * ignores. Some of these may best be handled by creating background * geometry rather than a solid background color */ void createJava3dObject() { // TODO: there are various attributes of // backdrops that we're not currently handling. In // particular, if the file calls for a gradient background // (solidBackdrop == 0), we ignore the request and just // create a solid background from the sky color instead. // We should be able to do something with the // various colors specified, perhaps by creating // background geometry with the appropriate vertex // colors? if (solidBackdrop != 0) { backgroundObject = new Background(color); debugOutput(VALUES, "Background color = " + color); } else { backgroundObject = new Background(skyColor); debugOutput(VALUES, "Background color = " + skyColor); } BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100000.0); backgroundObject.setApplicationBounds(bounds); }
BoundingSphere tmpSphere = new BoundingSphere(boundsObject); tmpSphere.transform(matrix); this.set(tmpSphere);
/** * Creates a SwitchValueInterpolator which is used to switch between * the objects specified for the sequence. This is done for files * that end in "000", meaning that there are a sequence of files * with that same base name that should specify every frame of a * sequence for an object. The Switch node is used to hold all of the * files and the Switch Behavior node is used to activate switching * at the right time and to the right object. */ private void createSwitchBehavior(Switch target) { int loopCount = -1; float animTime = 1000.0f * totalTime * (float)(target.numChildren())/(float)totalFrames; float startTime = 1000f * totalTime * (float)startFrame/(float)totalFrames; Alpha theAlpha = new Alpha(-1, (long)startTime, 0, (long)animTime, 0, 0); SwitchValueInterpolator b=new SwitchValueInterpolator(theAlpha,target); behaviors = b; BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 1000000.0); b.setSchedulingBounds(bounds); target.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); target.addChild(behaviors); }
BoundingSphere sphere = new BoundingSphere(boundsObject); sphere.transform(matrix); this.set(sphere);
f1.setSchedulingBounds(new BoundingSphere()); f1.setTransformGroup(objRotate); group.addChild(f1);
BoundingSphere bounds = new BoundingSphere(); rotator.setSchedulingBounds(bounds); objSpin.addChild(rotator);