I have been playing around with voxeljs, I'm new to 3D programming, and it says in the doc that this code generates the "sphere world":
generate: function(x,y,z) {
return x*x+y*y+z*z <= 20*20 ? 1 : 0 // sphere world
},
How is this actually generating a sphere? From my simple understanding, I think that it's basically "looping" through each "chunk" in the 3D world? Any further explanation or a point to a good tutorial on this would be a huge help!