Package javax.media.j3d

Examples of javax.media.j3d.BoundingSphere


    box2.setAppearance(appear2);

    final PointLight pointLight1 = new PointLight();
    pointLight1.setPosition(2, 2, 2);
    pointLight1.setColor(new Color3f(1f, 1f, 1f));
    pointLight1.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0),
        999));

    final PointLight pointLight2 = new PointLight();
    pointLight2.setPosition(2, 2, -2);
    pointLight2.setColor(new Color3f(1f, 1f, 0f));
    pointLight2.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0),
        999));

    final PointLight pointLight3 = new PointLight();
    pointLight3.setPosition(2, -2, 2);
    pointLight3.setColor(new Color3f(1f, 0f, 1f));
    pointLight3.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0),
        999));

    final PointLight pointLight4 = new PointLight();
    pointLight4.setPosition(-2, 2, 2);
    pointLight4.setColor(new Color3f(1f, 0f, 0f));
    pointLight4.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0),
        999));

    final PointLight pointLight5 = new PointLight();
    pointLight5.setPosition(2, -2, -2);
    pointLight5.setColor(new Color3f(1f, 0f, 0f));
    pointLight5.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0),
        999));

    final PointLight pointLight6 = new PointLight();
    pointLight6.setPosition(-2, 2, -2);
    pointLight6.setColor(new Color3f(0f, 0f, 0f));
    pointLight6.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0),
        999));

    final PointLight pointLight7 = new PointLight();
    pointLight7.setPosition(-2, -2, 2);
    pointLight7.setColor(new Color3f(0f, 0.5f, 1f));
    pointLight7.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0),
        999));

    final PointLight pointLight8 = new PointLight();
    pointLight8.setPosition(-2, -2, -2);
    pointLight8.setColor(new Color3f(0f, 0.5f, 1f));
    pointLight8.setInfluencingBounds(new BoundingSphere(new Point3d(0, 0, 0),
        999));

    // neue Transform Informationen

    // neue Branchgruppe
    this.branchgroup = new BranchGroup();

    // Transformgruppe an Branchgruppe h�ngen
    // branchgroup.addChild(box);
    // branchgroup.addChild(box2);
    this.branchgroup.addChild(new Koordinatensystem3d());

    this.branchgroup.addChild(pointLight1);
    this.branchgroup.addChild(pointLight2);
    this.branchgroup.addChild(pointLight3);
    this.branchgroup.addChild(pointLight4);
    this.branchgroup.addChild(pointLight5);
    this.branchgroup.addChild(pointLight6);
    this.branchgroup.addChild(pointLight7);
    this.branchgroup.addChild(pointLight8);

    final OrbitBehavior orbit = new OrbitBehavior(this,
        OrbitBehavior.REVERSE_ALL); // OrbitBehavior liegt in dem Paket
                                    // com.sun.j3d.utils.behaviors.vp
    orbit.setSchedulingBounds(new BoundingSphere(new Point3d(0, 0, 0), 999));
    this.universe.getViewingPlatform().setViewPlatformBehavior(orbit);
    // ... an das Universum h�ngen
    this.universe.addBranchGraph(this.branchgroup);
  }
View Full Code Here


        // construct the simple universe supplying it with
        // the canvas to render onto
        universe = new SimpleUniverse(this);
       
        // create bounds for scroling and lightning and so on
        bounds = new BoundingSphere(new Point3d(0,0,0), BOUNDSIZE);
       
        // create the base branch group in which our world
        // will be put
        scene = new BranchGroup();
     
View Full Code Here

    private Transform3D transAdd = new Transform3D();
    private Transform3D transRot = new Transform3D();
    private TransformGroup tg;
   
    public void initialize() {
        setSchedulingBounds(new BoundingSphere(new Point3d(0,0,0),100));
        wakeupOn(new WakeupOnAWTEvent(AWTEvent.KEY_EVENT_MASK));
    }
View Full Code Here

        this.force_multiplier = force;
    }
   
    public void initialize() {
      Graph<V,E> graph = getGraph();
      BoundingSphere d = getSize();
      if(graph != null && d != null) {

        try {
          for(E e : graph.getEdges()) {
            SpringEdgeData<E> sed = getSpringData(e);
View Full Code Here

                    xyd.set(
                        (float)(xyd.getX()+Math.max(-5, Math.min(5, vd.dx))),
                        (float)(xyd.getY()+Math.max(-5, Math.min(5, vd.dy))),
                        (float)(xyd.getZ()+Math.max(-5, Math.min(5, vd.dz))));
                   
                    BoundingSphere d = getSize();
                    float radius = (float) d.getRadius();
                   
                    if (xyd.getX() < -radius) {
                        xyd.set(-radius, xyd.getY(), xyd.getZ());//                     setX(0);
                    } else if (xyd.getX() > radius) {
                        xyd.set(radius, xyd.getY(), xyd.getZ());             //setX(width);
View Full Code Here

    /* ---------------Resize handler------------------ */

    public class SpringDimensionChecker extends ComponentAdapter {

        public void componentResized(ComponentEvent e) {
            setSize(new BoundingSphere(new Point3d(), e.getComponent().getWidth()));
        }
View Full Code Here

      doInit();
    }

    private void doInit() {
      Graph<V,E> graph = getGraph();
      BoundingSphere d = getSize();
      if(graph != null) {//&& d != null) {
        currentIteration = 0;
        temperature = d.getRadius() / 10;

        forceConstant =
          Math
          .sqrt(d.getRadius()
              * d.getRadius() * d.getRadius()
              / graph.getVertexCount());

        attraction_constant = attraction_multiplier * forceConstant;
        repulsion_constant = repulsion_multiplier * forceConstant;
      }
View Full Code Here

   */
  public void setSize(BoundingSphere size) {
   
    if(size != null && graph != null) {
     
      BoundingSphere oldSize = this.size;
      this.size = size;
      initialize();
     
      if(oldSize != null) {
        adjustLocations(oldSize, size);
View Full Code Here

    objLook.setMaterial(objMaterial);
    grayLook = objLook;
    final Appearance yellowLook = new Appearance();
    yellowLook.setMaterial(yellowMaterial);
    Bounds bounds =
      new BoundingSphere(new Point3d(),
          300);

    MouseRotate behavior1 = new MouseRotate();
    behavior1.setTransformGroup(objTrans);
    objTrans.addChild(behavior1);
View Full Code Here

          EdgeGroup eg = edgeMap.get(edge);
          eg.setEndpoints(layout.transform(start), layout.transform(end));
        }
      }});

    elayout.setSize(new BoundingSphere(new Point3d(), 200));
    elayout.initialize();
    VisRunner runner = new VisRunner((IterativeContext)elayout);
    runner.relax();

//    for(int i=0; i<objTrans.numChildren(); i++) {
View Full Code Here

TOP

Related Classes of javax.media.j3d.BoundingSphere

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.