Category : glm

I create a cube like normal using 8 vertex points that outline a cube and use indices to draw each individual triangle. However, when I create my camera matrix and rotate it using the lookat function with glm it rotates the entire screen positions not world positions. glm::mat4 Projection = glm::mat4(1); Projection = glm::perspective(glm::radians(60.0f), (float)window_width ..

Read more

I have the following code: void mouseCallback(GLFWwindow* window, double xpos, double ypos) { if (glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS) { const float radius = std::sqrt(std::pow(camX, 2) + std::pow(camY, 2) + std::pow(camZ, 2)); camX = (cos(ypos) + sin(ypos)) * radius; camY = (sin(xpos) + cos(ypos)) * radius; camZ = (cos(ypos) + sin(xpos)) * radius; } } this ..

Read more