Working camera using mouse
This commit is contained in:
parent
c8afd00b4b
commit
f648151410
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,3 +4,5 @@ Debug
|
||||
Release
|
||||
*.dll
|
||||
target
|
||||
.Spotlight-V100
|
||||
.vs
|
||||
|
@ -64,8 +64,8 @@ void mouse(int x, int y)
|
||||
|
||||
glm::mat4 createCameraMatrix()
|
||||
{
|
||||
glm::quat xMouseRotation = glm::angleAxis(mousePositionDifference[0], glm::vec3(1, 0, 0));
|
||||
glm::quat yMouseRotation = glm::angleAxis(mousePositionDifference[1], glm::vec3(0, 1, 0));
|
||||
glm::quat xMouseRotation = glm::angleAxis(mousePositionDifference[0] / 120, glm::vec3(0, 1, 0));
|
||||
glm::quat yMouseRotation = glm::angleAxis(mousePositionDifference[1] / 120, glm::vec3(1, 0, 0));
|
||||
|
||||
glm::quat mouseRotation = xMouseRotation * yMouseRotation;
|
||||
mousePositionDifference = {0, 0};
|
||||
|
Loading…
Reference in New Issue
Block a user