From c9905db6d2cd6175b67bf24dbb0775f8cabb2d63 Mon Sep 17 00:00:00 2001 From: TreetopFlyer Date: Tue, 6 Jul 2021 16:50:26 -0400 Subject: [PATCH] geometry buffer --- index.html | 77 ++++++++++++++++++++++++++++++++++++++++++------------ region.js | 44 +++++++++++++++++-------------- 2 files changed, 85 insertions(+), 36 deletions(-) diff --git a/index.html b/index.html index 590bbe3..a42ce20 100644 --- a/index.html +++ b/index.html @@ -20,30 +20,17 @@ - + \ No newline at end of file diff --git a/region.js b/region.js index 7eef695..c3cccff 100644 --- a/region.js +++ b/region.js @@ -20,6 +20,7 @@ export const Kernel = [ 0, 0, 1], [ 0, 0, -1] ], + Loop(inList, inVector, inHandler) { for(let i=0; i + inRegion.Filled = []; + inRegion.Surface = []; + var i; + for(i=0; i { - let kernel = Region.I(inX, inY, inZ); - if(!inRegion.voxels[kernel]) + let offsetIndex = Region.CoordsToIndex(inX, inY, inZ); + if(!inRegion.Voxels[offsetIndex]) { - console.log(coords, "surface"); - surface.push(inIndex); + inRegion.Surface.push(i); return true; } }); } - }); - return surface; + } + console.log("looped over", i); } };