-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgeoholo.lua
More file actions
37 lines (32 loc) · 713 Bytes
/
geoholo.lua
File metadata and controls
37 lines (32 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function eval(value)
return value < 0.1
end
rounds = 1
component = require "component";
geo = component.geolyzer;
holo = component.hologram;
offset = 24;
function multirun(x,z,times)
local t = geo.scan(x,z)
if times < 2 then return t end;
local count = times-1;
while count>0 do
local add = geo.scan(x,z)
for k,v in ipairs(add) do
t[k] = t[k]+v;
end
end
for k,v in ipairs(t) do
t[k]=v/times;
end
return t;
end
for x = -offset,offset,1 do
for z = -offset,offset,1 do
local t = multirun(x,z,rounds);
local t = geo.scan(x,z); -- todo: average multiple for higher rounds
for k,v in ipairs(t) do
holo.set(x+offset,k,z+offset,eval(v));
end
end
end