diff --git a/src/client/main.ts b/src/client/main.ts index 5438559..a9c149a 100644 --- a/src/client/main.ts +++ b/src/client/main.ts @@ -248,6 +248,7 @@ async function main() { y: $('#roty').val(), z: $('#rotz').val(), }, + rotSpeed: $('#rotspeed').val(), }; const [ @@ -378,6 +379,10 @@ async function main() { const rotz: any = $('#rotz').val(); params.rot.z = parseFloat(rotz); }); + $('#rotspeed').on('input', function() { + const rotSpeed: any = $('#rotspeed').val(); + params.rotSpeed = parseFloat(rotSpeed); + }); $('#fov').on('input', function() { const fov: any = $('#fov').val(); params.fov = parseFloat(fov); @@ -510,6 +515,9 @@ function drawScene(gl: any, -params.avg.y, -params.avg.z, ]); + mat4.rotateY(modelMatrix, + modelMatrix, + squareRotation); // Set the drawing position to the "identity" point, which is // the center of the scene. @@ -621,5 +629,5 @@ function drawScene(gl: any, gl.drawElements(gl.TRIANGLES, vertexCount, type, offset); } - squareRotation += deltaTime; + squareRotation += deltaTime * params.rotSpeed; } diff --git a/views/index.ejs b/views/index.ejs index 4b0fcb4..60bb62e 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -33,14 +33,18 @@
Change fov :
+
+
Change base rotation speed :
+ +
Change rotation :
X:
- +
Y:
- +
Z:
- +
@@ -58,6 +62,9 @@
+ This project's git +
+ My git

If you're on mobile, you need to set the shader to texture or sobel to change object, then you can change the shader