From f83c533f6f7f8a2e2d8aad1ea97401fdc5cb6569 Mon Sep 17 00:00:00 2001 From: Caenneth Date: Sat, 22 Jun 2024 10:19:56 +0200 Subject: [PATCH] added 4 camera positions - can switch between them with 1,2,3,4 keyboard input --- src/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main.c b/src/main.c index 0052472..db0c86d 100644 --- a/src/main.c +++ b/src/main.c @@ -55,6 +55,18 @@ SceneNode* rootNode; * Input handler for camera movement. * */ void handleInputs(double deltaTime) { + if (glfwGetKey(window, GLFW_KEY_1) == GLFW_PRESS) { + cameraPosition = (vec3){0.0f, 1.7f, 2.4f}; + } + if (glfwGetKey(window, GLFW_KEY_2) == GLFW_PRESS) { + cameraPosition = (vec3){3.3f, 3.4f, -11.0f}; + } + if (glfwGetKey(window, GLFW_KEY_3) == GLFW_PRESS) { + cameraPosition = (vec3){-3.0f, 2.9f, -7.5f}; + } + if (glfwGetKey(window, GLFW_KEY_4) == GLFW_PRESS) { + cameraPosition = (vec3){-0.6f, 2.1f, -4.5f}; + } if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS) { cameraPosition.z += deltaTime * 10; }