fix incorrect fills
This commit is contained in:
parent
56147ed325
commit
4078e026ef
@ -28,7 +28,6 @@ let surfaceTest = () =>
|
||||
let voxels = [];
|
||||
voxels[Region.I(2, 2, 2)] = true;
|
||||
voxels[Region.I(2, 3, 2)] = true;
|
||||
voxels[Region.I(3, 2, 2)] = true;
|
||||
let surface = Region.Surface(voxels)
|
||||
console.log(surface);
|
||||
|
||||
|
16
region.js
16
region.js
@ -104,21 +104,23 @@ export const Region =
|
||||
{
|
||||
let [x, y, z] = Region.XYZ(i);
|
||||
|
||||
console.log("at", x, y, z);
|
||||
|
||||
// bottom: at, "up", corner, right
|
||||
BA = i;
|
||||
BU = Region.I(x+1, y, z);
|
||||
BC = Region.I(x+1, y+1, z);
|
||||
BR = Region.I(x, y+1, z);
|
||||
BU = Region.I(x, y+1, z );
|
||||
BC = Region.I(x+1, y+1, z );
|
||||
BR = Region.I(x+1, y, z );
|
||||
|
||||
// top: at, "up" corner, right
|
||||
TA = Region.I(x, y, z+1);
|
||||
TU = Region.I(x+1, y, z+1);
|
||||
TU = Region.I(x, y+1, z+1);
|
||||
TC = Region.I(x+1, y+1, z+1);
|
||||
TR = Region.I(x, y+1, z+1);
|
||||
TR = Region.I(x+1, y, z+1);
|
||||
|
||||
// check: left, "down", below
|
||||
CL = Region.I(x-1, y, z);
|
||||
CD = Region.I(x, y-1, z);
|
||||
CL = Region.I(x-1, y, z );
|
||||
CD = Region.I(x, y-1, z );
|
||||
CB = Region.I(x, y, z-1);
|
||||
|
||||
if(!inVoxels[BU]){ Face(BU, BC, TC, TU); }
|
||||
|
Loading…
Reference in New Issue
Block a user