Skip to content

Instantly share code, notes, and snippets.

@kahrl
Created July 9, 2013 14:03
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/5957593 to your computer and use it in GitHub Desktop.
Save kahrl/5957593 to your computer and use it in GitHub Desktop.
function VoxelArea:position(i)
local p = {}
i = i - 1
p.z = math.floor(i / self.zstride) + self.MinEdge.z
i = i % self.zstride
p.y = math.floor(i / self.ystride) + self.MinEdge.y
i = i % self.ystride
p.x = math.floor(i) + self.MinEdge.x
return p
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment