Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit855063191ecec60c8cff468fd8f8302b41bf05a1 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-08-28 13:09:23 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-08-28 13:09:23 +0300
Files1901539e4350d34ef3fd09e3826283e70c5910d9
uni-projects-855063191ecec60c8cff468fd8f8302b41bf05a1.tar
uni-projects-855063191ecec60c8cff468fd8f8302b41bf05a1.tar.gz
uni-projects-855063191ecec60c8cff468fd8f8302b41bf05a1.zip
Parent16df4d95eaa0c8ab5566c2fa6693834269eae774 (diff)
[WGL/P] Limited precision of shown coordinates
1 files changed, 1 insertions, 1 deletions
-rw-r--r--Year 2/Computer Graphics with WebGL/Project/camera-movement.js2
diff --git a/Year 2/Computer Graphics with WebGL/Project/camera-movement.js b/Year 2/Computer Graphics with WebGL/Project/camera-movement.js
index f06db00..75d428e 100644
--- a/Year 2/Computer Graphics with WebGL/Project/camera-movement.js
+++ b/Year 2/Computer Graphics with WebGL/Project/camera-movement.js
@@ -159,6 +159,6 @@ function updateCamera() {
lookAt(pos, vecSum(pos, forward.toCartesian()), up.toCartesian());
// Update "external" variables
- if (coordsElem) coordsElem.innerText = 'X: '+pos[0]+' Y: '+pos[1]+' Z: '+pos[2];
+ if (coordsElem) coordsElem.innerText = 'X: '+pos[0].toFixed(2)+' Y: '+pos[1].toFixed(2)+' Z: '+pos[2].toFixed(2);
gl.uniform3fv(uEye, pos);
}