Select cells from 3D grid in certain radius
<p>I ran into a little problem today that I can't seem to solve in an efficient way. I'd like to select all cells of a 3D grid given the center of a sphere and the radius.</p>

<p>I have a cubic grid of cells, which all have the same dimensions, i.e. the cube has same width height and depth and is divided into sub cubes ("cells") that each have the same width height and depth as well.</p>

<p>Given a 3D position within this grid, I would like to draw all the cells around this position within the radius of the sphere. All cells that are partially contained in the sphere should be included in the drawing.</p>
