Skip to content
Snippets Groups Projects
Unverified Commit b575793b authored by Alexander Rose's avatar Alexander Rose Committed by GitHub
Browse files

Merge pull request #180 from sukolsak/fix-sheet-caps

Fix normals in sheet caps
parents 81bf6537 6186c60c
No related branches found
No related tags found
No related merge requests found
......@@ -44,14 +44,14 @@ function addCap(offset: number, state: MeshBuilder.State, controlPoints: ArrayLi
const { vertices, normals, indices } = state;
const vertexCount = vertices.elementCount;
v3fromArray(verticalLeftVector, normalVectors, offset);
v3scale(verticalLeftVector, verticalLeftVector, leftHeight);
v3fromArray(tA, normalVectors, offset);
v3scale(verticalLeftVector, tA, leftHeight);
v3scale(verticalRightVector, tA, rightHeight);
v3fromArray(verticalRightVector, normalVectors, offset);
v3scale(verticalRightVector, verticalRightVector, rightHeight);
v3fromArray(tB, binormalVectors, offset);
v3scale(horizontalVector, tB, width);
v3fromArray(horizontalVector, binormalVectors, offset);
v3scale(horizontalVector, horizontalVector, width);
v3cross(normalVector, tB, tA);
v3fromArray(positionVector, controlPoints, offset);
......@@ -74,8 +74,6 @@ function addCap(offset: number, state: MeshBuilder.State, controlPoints: ArrayLi
v3copy(verticalVector, verticalLeftVector);
}
v3cross(normalVector, horizontalVector, verticalVector);
for (let i = 0; i < 4; ++i) {
caAdd3(normals, normalVector[0], normalVector[1], normalVector[2]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment