Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sqrt = math.sqrt
- local component = require('component')
- local geolyzer = component.geolyzer
- local hologram = component.hologram
- local function distance(x, y, z)
- return sqrt(x^2 + y^2 + z^2)
- end
- local function magic(R, H, D)
- return 2112 * (R - H) / D % 1
- end
- local function visualize(hardness, elevation, size)
- hologram.clear()
- hologram.setScale(9)
- local blocks, result
- for x = -size, size do
- for z = -size, size do
- blocks = geolyzer.scan(x, z, elevation, 1, 1, 32)
- for i_y = 1, 32 do
- result = magic(blocks[i_y], hardness, distance(x, i_y+elevation-1, z))
- if blocks[i_y] ~= 0 and (result > 0.9998 or result < 0.00005) then
- hologram.set(x+24, i_y, z+24, true)
- end
- end
- end
- end
- end
- local hrd, ele, siz = table.unpack({...})
- hrd = hrd or 3
- ele = ele or -32
- siz = siz or 16
- visualize(hrd, ele, siz)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement