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
|
- Re: [JAVA3D] Andy Tay
- [JAVA3D] Andy Tay
- Re: [JAVA3D] Donald Casteel
- [JAVA3D] IGES Abhishek K. Agrawal
- Re: [JAVA3D] IGES John Sutter
- [JAVA3D] Andy Tay
- [JAVA3D] Bruno Sousa Caiado
- [JAVA3D] Andy Tay
- Re: [JAVA3D] Cromwell Enage
- Re: [JAVA3D] Ahmed Shakil
- Re: [JAVA3D] Andy Tay
- Re: [JAVA3D] Paul James
- [JAVA3D] help me ... please: how to move... z_mailing list
- Re: [JAVA3D] Casteel, Don
- [JAVA3D] Stanislav Panasik
- [JAVA3D] Illarramendi Amilibia, Aitor
- [JAVA3D] UNG Leng
- Re: [JAVA3D] UNG Leng
- [JAVA3D] alvaro zabala
- Re: [JAVA3D] J. Lee Dixon
- Re: [JAVA3D] alvaro zabala