Although my case is game-related, this is a general problem:
I have a 3D level, but the bounding cube for my level contains vast areas which are inaccessible by the player, and which I don't care about.
Now, I want fill my level with points, positioned every few units apart in each dimension.
At the moment I'm arbitrarily setting it to have 100 points in each axis (one million points per level), but that's obviously very wasteful.
I'm currently storing the points in a one-dimensional array, structured like: myArray[xScale+yScale+zScale] but I'm happy to change this.
So, what are my options for constructing a grid of points which only exist around relevant parts of the level?
Obviously I've considered just filling the none-relevant positions in the grid with NULL, but for each relevant position I need at least 32 bits of memory, and I really can't afford to waste that much on all of them.