auto enable invert z axis when not using virtual camera

This commit is contained in:
Luca Conte 2025-04-26 01:21:45 +02:00
parent f56912b41e
commit de72dafd2d
1 changed files with 8 additions and 1 deletions

View File

@ -72,6 +72,13 @@ async function init() {
});
document.getElementById("displayMatricesVirtually").addEventListener("input", (e) => {
displayMatricesVirtually = e.target.checked;
if (!displayMatricesVirtually) {
document.getElementById("invertZAxis").checked = true;
document.getElementById("invertZAxis").disabled = true;
} else {
document.getElementById("invertZAxis").checked = invertZAxis;
document.getElementById("invertZAxis").disabled = false;
}
});
document.getElementById("backfaceCulling").addEventListener("input", (e) => {
if (e.target.checked) {
@ -479,7 +486,7 @@ async function draw() {
let virtualProjectionMatrix = [];
mat4BuildPerspective(virtualProjectionMatrix, 90.0 / 180.0 * Math.PI, cv.width / cv.height, 1, 5);
mat4BuildPerspective(virtualProjectionMatrix, 90.0 / 180.0 * Math.PI, cv.width / cv.height, 0.9, 5);
if (!invertZAxis) {
let zAxisFlipMatrix = [];