Package javax.media.j3d

Examples of javax.media.j3d.Bounds


     *
     * @return <=0 if not supported, or the max distance from the origin for
     *         any point in the scene otherwise
     */
    protected float getSceneSize() {
        Bounds res=null;
        Enumeration<?> e=_viewingPlatform.getLocale().getAllBranchGraphs();
        while(e.hasMoreElements()){
            BranchGroup bg=(BranchGroup)e.nextElement();
            Bounds b=bg.getBounds();
            if(res==null){
                res=b;
            }
            else{
                res.combine(b);
View Full Code Here


    // ShapeNodeJava3D
    shape3d.setUserData(this);
   
    // scale the shape to have a reasonable size
    // and translate it to the origin
    Bounds bounds = transformGroup.getBounds();
    if (bounds instanceof BoundingSphere) {
      Point3d center = new Point3d();
      ((BoundingSphere)bounds).getCenter(center);
      Transform3D tr = new Transform3D();
      tr.setScale(10.0/((BoundingSphere)bounds).getRadius());
View Full Code Here

          computeBounds((Node)enumeration.nextElement(), bounds, parentTransformations);
        }
      } else if (node instanceof Link) {
        computeBounds(((Link)node).getSharedGroup(), bounds, parentTransformations);
      } else if (node instanceof Shape3D) {
        Bounds shapeBounds = ((Shape3D)node).getBounds();
        shapeBounds.transform(parentTransformations);
        bounds.combine(shapeBounds);
      }
    }
View Full Code Here

        computeBounds((Node)enumeration.nextElement(), bounds, parentTransformations);
      }
    } else if (node instanceof Link) {
      computeBounds(((Link)node).getSharedGroup(), bounds, parentTransformations);
    } else if (node instanceof Shape3D) {
      Bounds shapeBounds = ((Shape3D)node).getBounds();
      shapeBounds.transform(parentTransformations);
      bounds.combine(shapeBounds);
    }
  }
View Full Code Here

    Appearance objLook = new Appearance();
    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);
View Full Code Here

/*     */   }
/*     */
/*     */   public Bounds readBounds(DataInput in)
/*     */     throws IOException
/*     */   {
/*     */     Bounds bounds;
/* 877 */     switch (in.readInt()) {
/*     */     case 0:
/* 879 */       bounds = null;
/* 880 */       break;
/*     */     case 1:
View Full Code Here

TOP

Related Classes of javax.media.j3d.Bounds

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.