Skip to content

Instantly share code, notes, and snippets.

@kahrl
Created July 9, 2013 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kahrl/5957571 to your computer and use it in GitHub Desktop.
Save kahrl/5957571 to your computer and use it in GitHub Desktop.
function VoxelArea:position(i)
i = i - 1
local x = i % self.ystride
local y = ((i-x) % self.zstride) / self.ystride
local z = (i - i % self.zstride) / self.zstride
return {
x = x + self.MinEdge.x,
y = y + self.MinEdge.y,
z = z + self.MinEdge.z
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment