This commit is contained in:
Kbz-8
2024-02-14 20:22:07 +01:00
committed by AdrienLSH
parent 8643f3ef15
commit 4d126c1683
5 changed files with 192 additions and 18 deletions

View File

@ -27,16 +27,8 @@ function renderCube(ctx, x, y, z, angle = 0, sx = 1, sy = 1, sz = 1)
mat4.invert(normalMatrix, modelMatrix);
mat4.transpose(normalMatrix, normalMatrix);
ctx.uniformMatrix4fv(
shaderInfos.uniformLocations.modelMatrix,
false,
modelMatrix
);
ctx.uniformMatrix4fv(
shaderInfos.uniformLocations.normalMatrix,
false,
normalMatrix,
);
ctx.uniformMatrix4fv(shaderInfos.uniformLocations.modelMatrix, false, modelMatrix);
ctx.uniformMatrix4fv(shaderInfos.uniformLocations.normalMatrix, false, normalMatrix);
ctx.drawElements(ctx.TRIANGLES, 36, ctx.UNSIGNED_SHORT, 0);
}