private void updateFond(GrBoite _boite) { buildFond(null); if (_boite == null) return; double maxDist = Math.max(Math.max(_boite.getDeltaX(), _boite.getDeltaY()), _boite.getDeltaZ()); background_.setApplicationBounds(new BoundingSphere(new Point3d(_boite.getMidX(), _boite.getMidY(), _boite .getMidZ()), maxDist * 20)); }
public static BLumiereDirectionnelle createLumiere(final BGroupeVolume _gv) { GrBoite boite; boite = _gv.getBoite(); final double dx = Math.abs(boite.getDeltaX()); final double dz = Math.abs(boite.getDeltaZ()); final double dy = Math.abs(boite.getDeltaY()); final BLumiereDirectionnelle l1 = new BLumiereDirectionnelle(new Vector3f(0, 0, -1), Color.white); double dist = (dx * dx + dy * dy) / 4; dist = Math.sqrt(dz * dz + dist); final BoundingSphere sphere = new BoundingSphere(new Point3d(boite.o_.x_ + dx / 2, boite.o_.y_ + dy / 2, boite.e_.z_), dist); l1.setBounds(sphere); l1.setIntensite(0.3); l1.setDirection(new Vector3f(0, 0.1f, -1f)); l1.setRapide(false); l1.setVisible(true); return l1; }
public void start() { trajectoire_ = new RotPosPathInterpolator(new Alpha(nbCycles_, temps_), univers_.getTransformGroup(), axe_, pourcentAtIndex_, directions_, positions_); trajectoire_.setSchedulingBounds(new BoundingSphere()); bg_ = new BranchGroup(); bg_.setCapability(BranchGroup.ALLOW_DETACH); bg_.addChild(trajectoire_); univers_.addBranchGraph(bg_); }
public BLumiereDirectionnelle(final Vector3f _vecteur, final Color _couleur) { couleur_ = _couleur; direction_ = _vecteur; l_ = new DirectionalLight(new Color3f(_couleur), _vecteur); l_.setCapability(Light.ALLOW_STATE_WRITE); l_.setCapability(Light.ALLOW_STATE_READ); l_.setCapability(Light.ALLOW_COLOR_WRITE); l_.setCapability(Light.ALLOW_COLOR_READ); l_.setCapability(DirectionalLight.ALLOW_DIRECTION_WRITE); l_.setCapability(DirectionalLight.ALLOW_DIRECTION_READ); l_.setCapability(Node.ALLOW_BOUNDS_READ); l_.setCapability(Node.ALLOW_BOUNDS_WRITE); l_.setCapability(Light.ALLOW_INFLUENCING_BOUNDS_READ); l_.setCapability(Light.ALLOW_INFLUENCING_BOUNDS_WRITE); setCapability(ALLOW_AUTO_COMPUTE_BOUNDS_READ); setCapability(ALLOW_AUTO_COMPUTE_BOUNDS_READ); l_.setInfluencingBounds(new BoundingSphere(new Point3d(), 100)); for (int i = 18; i < 20; i++) { l_.setCapability(i); } addChild(l_); setName("Direction"); }
elayout.setSize(new BoundingSphere(new Point3d(), 200)); elayout.initialize(); VisRunner runner = new VisRunner((IterativeContext)elayout);
yellowLook.setMaterial(yellowMaterial); Bounds bounds = new BoundingSphere(new Point3d(), 300);