Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. Correct view matrix setup
  2.  
  3. glm::mat4 viewMatrix = glm::lookAt(glm::vec3(-20,20,20), glm::vec3(0,10,0), glm::vec3(0,1,0));
  4.  
  5.  
  6.  
  7. Quaternion-style (incorrect) matrix setup
  8.  
  9. glm::quat orientation = glm::angleAxis(glm::radians(0.0f), glm::vec3(20,-10,20));
  10. glm::mat4 rotationMatrix = glm::mat4(orientation);
  11. glm::mat4 translationMatrix = glm::translate(glm::mat4(1.0f), glm::vec3(20.0f,-20.0f,-20.0f));
  12. glm::mat4 viewMatrix = translationMatrix * rotationMatrix;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement