From 62838e3b645d2590b9fe51a1723b3976e8e873a9 Mon Sep 17 00:00:00 2001 From: stitchy Date: Thu, 26 Dec 2024 04:15:00 +0000 Subject: [PATCH] feat: reset button --- main.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.mjs b/main.mjs index 97772b8..65ae4b1 100644 --- a/main.mjs +++ b/main.mjs @@ -60,6 +60,15 @@ function draw(gl, program) { requestAnimationFrame(() => draw(gl, program)); } +const button = document.getElementById("reset_button"); + +button.addEventListener("click", reset_transform); + +function reset_transform() { + camera_pos = [0, 0, 0]; + mouse_pos = [0, 0]; +} + //** MAIN PROGRAM **// // Initialize the shader