diff --git a/src/main.cpp b/src/main.cpp index 5e0c337..c4eefb2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -101,6 +101,8 @@ int main(int argc, char **argv) auto imu_base_mat = glm::translate(glm::mat4(1.0f), glm::vec3(2.0,0.0,0.0)); imu.setModelMatrix(imu_base_mat); + auto imu_correction_matrix = glm::rotate(glm::mat4(1.0f), glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f)); + auto imu_correction_inverse = glm::inverse(imu_correction_matrix); glEnable(GL_DEPTH_TEST); @@ -181,8 +183,6 @@ int main(int argc, char **argv) coords.render(); auto imu_rot_mat = imu_serial.get_rot_matrix(); - auto imu_correction_matrix = glm::rotate(glm::mat4(1.0f), glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f)); - auto imu_correction_inverse = glm::inverse(imu_correction_matrix); auto imu_model_matrix = imu_base_mat * imu_correction_inverse * imu_rot_mat * imu_correction_matrix;