Hi I'm trying to implement the Uniform Spatial subdivision in C++ for a ray tracing class and trying to implement the ray traversals using the algorithm given in Fundamentals of Computer Graphics by Peter Shirley. I'm trying to understand how voxels/cells are created in C++. Trying to define the gird here but I'm stuck at constructing or rather defining the grid and divide them into cells.

Here is the link to my code: [C++] Uniform Spatial Subdivision - Pastebin.com

Can any one help with it.

Thanks