Merge branch 'visualisations' into prod
This commit is contained in:
commit
58e8328042
|
@ -34,6 +34,7 @@ let virtualRealInterpolation = 1;
|
||||||
let cameraPitch = 0.565;
|
let cameraPitch = 0.565;
|
||||||
let cameraYaw = 0.375;
|
let cameraYaw = 0.375;
|
||||||
let cameraDistance = 4;
|
let cameraDistance = 4;
|
||||||
|
let smoothCameraDistance = 4;
|
||||||
|
|
||||||
let mouseDragging = false;
|
let mouseDragging = false;
|
||||||
|
|
||||||
|
@ -434,6 +435,8 @@ async function draw() {
|
||||||
virtualRealInterpolation = Math.max(virtualRealInterpolation - deltaTime * 2, 0);
|
virtualRealInterpolation = Math.max(virtualRealInterpolation - deltaTime * 2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
smoothCameraDistance += (cameraDistance - smoothCameraDistance) / 8;
|
||||||
|
|
||||||
updateStats(deltaTime);
|
updateStats(deltaTime);
|
||||||
|
|
||||||
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
||||||
|
@ -448,7 +451,7 @@ async function draw() {
|
||||||
mat4BuildPerspective(realProjectionMatrix, 90.0 / 180.0 * Math.PI, cv.width / cv.height, 0.1, 30);
|
mat4BuildPerspective(realProjectionMatrix, 90.0 / 180.0 * Math.PI, cv.width / cv.height, 0.1, 30);
|
||||||
|
|
||||||
let realViewMatrix = [];
|
let realViewMatrix = [];
|
||||||
let realCameraPosition = [Math.cos(cameraYaw) * cameraDistance * Math.cos(cameraPitch), Math.sin(cameraPitch) * cameraDistance, Math.sin(cameraYaw) * cameraDistance * Math.cos(cameraPitch)];
|
let realCameraPosition = [Math.cos(cameraYaw) * smoothCameraDistance * Math.cos(cameraPitch), Math.sin(cameraPitch) * smoothCameraDistance, Math.sin(cameraYaw) * smoothCameraDistance * Math.cos(cameraPitch)];
|
||||||
let realCameraLookAt = [0, 0, 0];
|
let realCameraLookAt = [0, 0, 0];
|
||||||
let realCameraUp = [0, 1, 0];
|
let realCameraUp = [0, 1, 0];
|
||||||
// if (cameraPitch > -0.1) {
|
// if (cameraPitch > -0.1) {
|
||||||
|
|
Loading…
Reference in New Issue