# Help with voxel storage ideas

## Recommended Posts

Butabee    274
I'm trying to think of a very low memory way to store voxels and I was thinking of having something like storage containers that would be an object with an X, Y, or Z position and it would have a number specifying how many voxels that are along that positions plane, for instance an X object would have maybe 50 voxels with how many voxels there are at that X position anywhere along the x and y axis but I'm having trouble determining individual voxel positions with this method. I need to cross reference the X, Y, and Z objects to somehow determine individual voxel positions.

I think there's a way to do this but I'm not sure how to do it.

##### Share on other sites
Psilobe    193
[quote name='Butabee' timestamp='1306112223' post='4814397']
I'm trying to think of a very low memory way to store voxels and I was thinking of having something like storage containers that would be an object with an X, Y, or Z position and it would have a number specifying how many voxels that are along that positions plane, for instance an X object would have maybe 50 voxels with how many voxels there are at that X position anywhere along the x and y axis but I'm having trouble determining individual voxel positions with this method. I need to cross reference the X, Y, and Z objects to somehow determine individual voxel positions.

I think there's a way to do this but I'm not sure how to do it.
[/quote]

If I understand you correctly you are trying to create a system that's similar to the chunks used in minecraft. There a chunk is 16*16*16 blocks. Then you might have 4*4*4 of these chunks. If you have these chunks in worldspace you can just offset your voxels by the amount in the chunks. If your voxel is in chunk 4,0,0 (X,Y,Z) and each chunk is the 16*16*16 size then your world pos would be 3*16+(voxelinchunk.x) for the xpos.

## Create an account

Register a new account