fixed
they're now unified, but flipped :P
This commit is contained in:
parent
c3f29258be
commit
d62a1e7357
1
app.js
1
app.js
@ -23,7 +23,6 @@ let rebuildSurface = inVoxels =>
|
||||
|
||||
surfaceCubeGeometry.setAttribute("position", new T.BufferAttribute(pos, 3));
|
||||
surfaceCubeGeometry.setIndex(ind);
|
||||
//surfaceCubeGeometry.computeVertexNormals();
|
||||
};
|
||||
rebuildSurface(voxels);
|
||||
|
||||
|
12
region.js
12
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user