auto enable invert z axis when not using virtual camera
This commit is contained in:
parent
f56912b41e
commit
de72dafd2d
|
@ -72,6 +72,13 @@ async function init() {
|
||||||
});
|
});
|
||||||
document.getElementById("displayMatricesVirtually").addEventListener("input", (e) => {
|
document.getElementById("displayMatricesVirtually").addEventListener("input", (e) => {
|
||||||
displayMatricesVirtually = e.target.checked;
|
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) => {
|
document.getElementById("backfaceCulling").addEventListener("input", (e) => {
|
||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
|
@ -479,7 +486,7 @@ async function draw() {
|
||||||
|
|
||||||
|
|
||||||
let virtualProjectionMatrix = [];
|
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) {
|
if (!invertZAxis) {
|
||||||
let zAxisFlipMatrix = [];
|
let zAxisFlipMatrix = [];
|
||||||
|
|
Loading…
Reference in New Issue