Sign in to follow this  
ch71

Convert 3D Coordinates to Single Index

Recommended Posts

I would like to represent a 3D array as a 1D dynamically-sized list for voxel storage. How can I convert between a single number (representing an index in the 1D list) to a 3D coordinate and vice versa? I've heard it's possible, and I don't see why not, but the solution does not immediately present itself to me.

Share this post


Link to post
Share on other sites
Found the same question already answered on StackOverflow. [url="http://stackoverflow.com/questions/7367770/how-to-flatten-or-index-3d-array-in-1d-array"]http://stackoverflow.com/questions/7367770/how-to-flatten-or-index-3d-array-in-1d-array[/url]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this