Package jray.common

Examples of jray.common.Sphere


    Vect3 dist=new Vect3();
   
    System.out.print("Building octree... ");
   
    for(Object3D o : objects){
      Sphere s = o.getBoundingSphere();
      if(s!=null){
        Vect.subtract(center, s.getPosition(), dist);
        qdist = s.getRadius();
        if(Double.isInfinite(qdist)||Double.isNaN(qdist))
          throw new RuntimeException("Invalid BoundingSphere: "+s+" from "+o);
        qdist = qdist*qdist + dist.quadLength();
        if(maxQuadDist < qdist)
          maxQuadDist = qdist;
View Full Code Here


     
      if(Math.random()<0.5){
        objects.add(new Cone(new Vect3(x,y+2,z),new Vect3(t0,-1.6,t1),10,leafColor));
        objects.add(new Cone(new Vect3(x,y+2,z),new Vect3(t0*2,-2,t1*2),1,0xFF8B4513));
      }else{
        objects.add(new Sphere(new Vect3(x,y+1.5-ld/2,z),ld,leafColor));
        objects.add(new Cone(new Vect3(x,y+1.5,z),new Vect3(t0*2,-1.5,t1*2),1,0xFF8B4513));
      }
    }
View Full Code Here

  private List<Object3D> objects;
  private Camera cam;
 
  public KugelTest(){
    objects = new ArrayList<Object3D>();
    objects.add(new Sphere(new Vect3(0,0,0),1,0xFFFFFF00));
    cam = new Camera(new Vect3(0,0,-5),new Vect3(0,0,-3),new Vect3(0,1,0));
  }
View Full Code Here

   
    Vect3 avg = getBoundingSphereCenter();
    Vect3 tmp = new Vect3();
    Vect.subtract(avg, v3, tmp);
     
    bounds = new Sphere(avg,tmp.length(),0xFF000000);
  }
View Full Code Here

      if(dist > radius){
        radius = dist;
      }
    }
   
    bounds = new Sphere(max, radius, 0xFF000000);
   
    tree = Octree.buildTree(bounds.getPosition(), Arrays.asList(triangles));
   
    for(MinimalTriangle m : triangles)
      m.purge();
View Full Code Here

TOP

Related Classes of jray.common.Sphere

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.