minimite

x

Jan 2nd, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. component = require "component"
  2.     g = component.glasses
  3.     args = {...}
  4.  
  5.     xs =args[1]
  6.     ys =args[2]
  7.     zs =args[3]
  8.  
  9.     r = args[4]
  10.  
  11.     g.removeAll()
  12.  
  13.  
  14.     function check(x,y,z,r)
  15.      return  (((x-xs)*(x-xs)) + ((y-ys)*(y-ys)) + ((z-zs)*(z-zs))) <= (r*r)
  16.     end
  17.  
  18.     for x=xs-r, xs+r do
  19.       for y = xs-r, xs+r do
  20.         for z = zs-r, zs+r do
  21.           if check(x,y,z,r) and not check(x,y,z,r-1) then
  22.             c = g.addCube3D()
  23.             c.set3DPos(x,y,z)
  24.             c.setScale(tonumber(args[5]))
  25.             c.setAlpha(0.4)
  26.           end
  27.           os.sleep(0)
  28.          end
  29.       end
  30.     end
Add Comment
Please, Sign In to add comment