Does anyone knows how to set all my int values to float.. Cos i try to change my int v; to float but they show me an error that say
 
 Incompatible type for new. Explicit cast needed to convert float to int.
 coordinates = new Point3f[v];
 
Andy
 
private Geometry sphereGeometry() {
 
  int r = 1;
  int xc = 0;
  int yc = 0;
  int zc = 0;
  int v;
  int bvol;
  float rx, ry, rz, spanx, spany, spanz, randx, randy, randz;
 
  bvol = ((xc+r)-(xc-r))*((yc+r)-(yc-r))*((zc+r)-(zc-r));
 
  v = (bvol*200);
 
  Point3f[] coordinates;
 
  coordinates = new Point3f[v];
 
  spanx = (xc+r)-(xc-r);
  spany = (yc+r)-(yc-r);
  spanz = (zc+r)-(zc-r);
 
 
 
  for (int i=0; i<v; i++)
  {
  coordinates[i] = new Point3f ();
  //}
 
  //for(int f=0; f<v; f++){
   randx = (xc-r) + (float) (Math.random() * spanx);
   randy = (yc-r) + (float) (Math.random() * spany);
   randz = (zc-r) + (float) (Math.random() * spanz);
 
   rx = (randx*spanx)+(xc-r);
   ry = (randy*spany)+(yc-r);
   rz = (randz*spanz)+(zc-r);
 
   if (((rx-xc)*(rx-xc))+((ry-yc)*(ry-yc))+((rz-zc)*(rz-zc)) <= ((r)*(r)))
   {
    coordinates[i].x = rx;
    coordinates[i].y = ry;
    coordinates[i].z = rz;
   }
  }
 
  PointArray point = new PointArray(v, PointArray.COORDINATES);
  point.setCoordinates(0, coordinates);
 
        return point;
 
 } // end of method SphereGeometry in class Bone

Reply via email to