fix incorrect fills
This commit is contained in:
parent
56147ed325
commit
4078e026ef
@ -28,7 +28,6 @@ let surfaceTest = () =>
|
|||||||
let voxels = [];
|
let voxels = [];
|
||||||
voxels[Region.I(2, 2, 2)] = true;
|
voxels[Region.I(2, 2, 2)] = true;
|
||||||
voxels[Region.I(2, 3, 2)] = true;
|
voxels[Region.I(2, 3, 2)] = true;
|
||||||
voxels[Region.I(3, 2, 2)] = true;
|
|
||||||
let surface = Region.Surface(voxels)
|
let surface = Region.Surface(voxels)
|
||||||
console.log(surface);
|
console.log(surface);
|
||||||
|
|
||||||
|
16
region.js
16
region.js
@ -104,21 +104,23 @@ export const Region =
|
|||||||
{
|
{
|
||||||
let [x, y, z] = Region.XYZ(i);
|
let [x, y, z] = Region.XYZ(i);
|
||||||
|
|
||||||
|
console.log("at", x, y, z);
|
||||||
|
|
||||||
// bottom: at, "up", corner, right
|
// bottom: at, "up", corner, right
|
||||||
BA = i;
|
BA = i;
|
||||||
BU = Region.I(x+1, y, z);
|
BU = Region.I(x, y+1, z );
|
||||||
BC = Region.I(x+1, y+1, z);
|
BC = Region.I(x+1, y+1, z );
|
||||||
BR = Region.I(x, y+1, z);
|
BR = Region.I(x+1, y, z );
|
||||||
|
|
||||||
// top: at, "up" corner, right
|
// top: at, "up" corner, right
|
||||||
TA = Region.I(x, y, z+1);
|
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);
|
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
|
// check: left, "down", below
|
||||||
CL = Region.I(x-1, y, z);
|
CL = Region.I(x-1, y, z );
|
||||||
CD = Region.I(x, y-1, z);
|
CD = Region.I(x, y-1, z );
|
||||||
CB = Region.I(x, y, z-1);
|
CB = Region.I(x, y, z-1);
|
||||||
|
|
||||||
if(!inVoxels[BU]){ Face(BU, BC, TC, TU); }
|
if(!inVoxels[BU]){ Face(BU, BC, TC, TU); }
|
||||||
|
2
scene.js
2
scene.js
@ -45,7 +45,7 @@ export function Scene(inSettings)
|
|||||||
scene.add(light);
|
scene.add(light);
|
||||||
//scene.add(new T.GridHelper(10, 10));
|
//scene.add(new T.GridHelper(10, 10));
|
||||||
light.position.set(-1, 2, 4);
|
light.position.set(-1, 2, 4);
|
||||||
camera.position.set(0, 5, -5);
|
camera.position.set(0, 5, 5);
|
||||||
camera.lookAt(new T.Vector3(0,0,0));
|
camera.lookAt(new T.Vector3(0,0,0));
|
||||||
controls.update();
|
controls.update();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user