add versor dependency, generate rotor matrix

This commit is contained in:
2018-12-19 22:59:38 -05:00
parent 83d0ce5ef3
commit 78195ef8ec
6 changed files with 27 additions and 69 deletions

View File

@@ -113,7 +113,9 @@ class GLApp : public App {
glfwGetFramebufferSize(getWindow(), &width, &height);
float ratio = (float) width / height;
matrices.model = rotor_yw(getTime() / 5) * rotor_xz(getTime() / 2);
matrices.model =
rotor(glm::vec4(1,0,0,0), glm::vec4(0,0,1,0), getTime() / 4) *
rotor(glm::vec4(0,1,0,0), glm::vec4(0,0,0,1), getTime() / 4);
matrices.view = glm::lookAt(glm::vec3(0, 0, -2), glm::vec3(0, 0, 0), glm::vec3(0, 1, 0));
matrices.proj = glm::perspective(1.f, ratio, 0.1f, 10.0f);