Skip to content
Snippets Groups Projects
Commit dab6bc9f authored by Vanessa Karolek's avatar Vanessa Karolek
Browse files

[#42][Fix] mirror rotation around X axis

For convenience reasons:
- Right mouse movement leads to camera movement to the left (background changes to the right)
- Left mouse movement leads to camera movement to the right (background changes to the left)
parent db0f5304
No related branches found
No related tags found
1 merge request!35Resolve "Kamera - Trackballkamera"
Pipeline #25356 passed
......@@ -69,7 +69,7 @@ namespace vkcv {
void TrackballCamera::updatePosition(double deltaTime) {
glm::mat4 rotationY = glm::rotate(glm::mat4(1.0f), glm::radians(m_yaw), glm::vec3(0.0f, -1.0f, 0.0f));
glm::mat4 rotationX = glm::rotate(rotationY, glm::radians(m_pitch), glm::vec3(1.0f, 0.0f, 0.0f));
glm::mat4 rotationX = glm::rotate(rotationY, -glm::radians(m_pitch), glm::vec3(1.0f, 0.0f, 0.0f));
glm::vec3 translate = glm::vec3(0.0f,0.0f,m_radius);
translate = glm::vec3(rotationX * glm::vec4(translate, 0.0f));
m_position = m_center + translate;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment