diff --git a/app.js b/app.js index c7151ab..0b960ce 100644 --- a/app.js +++ b/app.js @@ -23,7 +23,6 @@ let rebuildSurface = inVoxels => surfaceCubeGeometry.setAttribute("position", new T.BufferAttribute(pos, 3)); surfaceCubeGeometry.setIndex(ind); - //surfaceCubeGeometry.computeVertexNormals(); }; rebuildSurface(voxels); diff --git a/region.js b/region.js index 8e451ff..815406e 100644 --- a/region.js +++ b/region.js @@ -136,13 +136,13 @@ const Region = CD = Region.I(x, y-1, z ); CB = Region.I(x, y, z-1); - if(!inVoxels[BU]){ Face(BU, BC, TC, TU); } // XZ (away from origin) | "top" (these labels assume y-up) - if(!inVoxels[BR]){ Face(BC, BR, TR, TC); } // YZ (away from origin) | "side" - if(!inVoxels[TA]){ Face(TA, TU, TC, TR); } // XY (away from origin) | "side" + if(!inVoxels[BU]){ Face(BU, BC, TC, TU); } // XZ (away from origin) + if(!inVoxels[BR]){ Face(BC, BR, TR, TC); } // YZ (away from origin) + if(!inVoxels[TA]){ Face(TA, TU, TC, TR); } // XY (away from origin) - if(!inVoxels[CL]){ Face(BA, BU, TU, TA); } // YZ (touches the origin) | "side" - if(!inVoxels[CD]){ Face(BR, BA, TA, TR); } // XZ (touches the origin) | "bottom" - if(!inVoxels[CB]){ Face(BA, BU, BC, BR); } // XY (touches the origin) | "side" <-- this one needs normals flipped + if(!inVoxels[CL]){ Face(BA, BU, TU, TA); } // YZ (touches the origin) + if(!inVoxels[CD]){ Face(BR, BA, TA, TR); } // XZ (touches the origin) + if(!inVoxels[CB]){ Face(BU, BA, BR, BC); } // XY (touches the origin) } }