Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Correct view matrix setup
- glm::mat4 viewMatrix = glm::lookAt(glm::vec3(-20,20,20), glm::vec3(0,10,0), glm::vec3(0,1,0));
- Quaternion-style (incorrect) matrix setup
- glm::quat orientation = glm::angleAxis(glm::radians(0.0f), glm::vec3(20,-10,20));
- orientation = glm::normalize(orientation);
- glm::mat4 rotationMatrix = glm::mat4(orientation);
- glm::mat4 translationMatrix = glm::translate(glm::mat4(1.0f), glm::vec3(20.0f,-20.0f,-20.0f));
- glm::mat4 viewMatrix = translationMatrix * rotationMatrix;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement