Update
This commit is contained in:
parent
2b4cf24991
commit
7b8b122341
@ -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));
|
auto imu_base_mat = glm::translate(glm::mat4(1.0f), glm::vec3(2.0,0.0,0.0));
|
||||||
imu.setModelMatrix(imu_base_mat);
|
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);
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
@ -181,8 +183,6 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
coords.render();
|
coords.render();
|
||||||
auto imu_rot_mat = imu_serial.get_rot_matrix();
|
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;
|
auto imu_model_matrix = imu_base_mat * imu_correction_inverse * imu_rot_mat * imu_correction_matrix;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user