I want to build a voxel model from a 3D model, so that each voxel can be either true or false
At a high level this sounds rather easy - create a NxNxN array and shoot a bunch of rays through your model, as the ray reaches each voxel check if the number ray-poly collisions is odd or even.
But will this work? If I create a 256x256x256 array aligned to x/y/z axes, can I simply do:
for(x=0 to 256)
for(y=0 to 256)
fire_ray(0,0,1) Or would I have to send rays from each plane and average them somehow? I'm concerned primarily about missing polygons parallel to the rays but it seems to me a in well-formed closed polygon model this shouldn't be a problem?