Haphazardly fix the animation not being very visible on some screens

Would be *much* better to come up with a proper projection matrix, but
I need some actual time to think about the maths.
pull/6/head
Tristan Daniël Maat 2022-08-13 23:56:03 +01:00
parent 599880f035
commit 4336c718fc
Signed by: tlater
GPG Key ID: 49670FD774E43268
1 changed files with 5 additions and 1 deletions

View File

@ -230,7 +230,11 @@ class Renderer {
this.rotation += (this.dTime / 1000.0) * ROTATION_SPEED;
const modelViewMatrix = mat4.create();
mat4.translate(modelViewMatrix, modelViewMatrix, [0.0, 0.025, -1.2]);
mat4.translate(modelViewMatrix, modelViewMatrix, [
0.0,
0.025,
-((this.analyser.frequencyBinCount / gl.canvas.clientWidth) * 3),
]);
mat4.rotateX(modelViewMatrix, modelViewMatrix, Math.PI / 16);
mat4.rotateY(modelViewMatrix, modelViewMatrix, this.rotation);
mat4.translate(modelViewMatrix, modelViewMatrix, [-1.0, 0.0, 0.0]);