Hi
been trying for a hour to do this without much luck
I have Have some arrays
Gridz[9,9,9]
Gridx[9,9,9]
Gridy[9,9,9]
For x=0 to 8
For y=0 to 8
For z=0 to 8
Gridx[x,y,z]=-256+(64*x)
Gridy[x,y,z]=256-(64*y)
Gridz[x,y,z]=-256+(64*z)
next
next
next
Next i Create 3 random floats within the range of -256 to 256
floatx#=Rnd(-288,288)
floaty#=Rnd(-288,288)
floatz#=Rnd(-288,288)
now comes my problem
I want to Get these values in ints so i can find out what was the closest Grid array in x,y,z
So Floatx,Floaty,Floatz need to be Rounded to the nearest multipul of 64
anyideas welcome thanks
been trying for a hour to do this without much luck
I have Have some arrays
Gridz[9,9,9]
Gridx[9,9,9]
Gridy[9,9,9]
For x=0 to 8
For y=0 to 8
For z=0 to 8
Gridx[x,y,z]=-256+(64*x)
Gridy[x,y,z]=256-(64*y)
Gridz[x,y,z]=-256+(64*z)
next
next
next
Next i Create 3 random floats within the range of -256 to 256
floatx#=Rnd(-288,288)
floaty#=Rnd(-288,288)
floatz#=Rnd(-288,288)
now comes my problem
I want to Get these values in ints so i can find out what was the closest Grid array in x,y,z
So Floatx,Floaty,Floatz need to be Rounded to the nearest multipul of 64
anyideas welcome thanks