Skip to content

Instantly share code, notes, and snippets.

@PilzAdam
Created July 9, 2013 13:57
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 PilzAdam/5957550 to your computer and use it in GitHub Desktop.
Save PilzAdam/5957550 to your computer and use it in GitHub Desktop.
area = VoxelArea:new{
MinEdge = { x=-10, y=-20, z=-40 },
MaxEdge = { x=10, y=20, z=40 },
}
--local x,y,z = math.random(-10,10), math.random(-20,20), math.random(-40,40)
local x,y,z = 10,20,40
print(x,y,z)
local i = area:indexp({x=x, y=y, z=z})
local p = area:position(i)
print(dump(p))
assert(p.x == x and p.z == z and p.y == y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment