I am modding a game (Red Alert 2) that uses a semi-3d format to display all units in the game. Volume Pixels, or voxels are a primitive 3d format that is somewhat hard to edit using the open source builders that the community has developed. I do much of my moddeling work in maya and it is converted to Voxel format. Voxels them selves are small cubes stacked together that form a tank or other unit. There are converters from 3d to voxel, but in the process, the modelled unit in the 3d file looses it's quality, and the unit that you created may not look like anything close to the voxel that was created.
I am trying to simply build the small cubed voxels in Maya, then converting them over, thus removing the need to edit voxels after the 3d conversion, because they would technically be the exact same.
So here is my Question. I want to be able to model normally, but I need a mel script to turn the Meshes in my model into the Cube-like structure that voxels use. So I would basically be putting a few thousand cubes in place of the Polygon meshes. All the cubes need to be perfecly touching each other in a 3d grid pattern, and only inside the polygons that I have made. So how would I tell the computer to put cubes only inside the polygons?