I noticed that you can also get errors if you did not specify the correct angles, even if you use glm::rotate(Model, angle_in_degrees, glm::vec3(x, y, z)) , you can still encounter problems . The fix I found for this indicated the type as glm::rotate(Model, (glm::mediump_float)90, glm::vec3(x, y, z)) instead of just saying glm::rotate(Model, 90, glm::vec3(x, y, z))
Or simply write the second argument, the angle in radians (previously in degrees), like a float without any throw, for example, in:
glm::mat4 rotationMatrix = glm::rotate(glm::mat4(1.0f), 3.14f, glm::vec3(1.0));
You can add glm :: radians () if you want to continue using degrees. And add include:
#include "glm/glm.hpp" #include "glm/gtc/matrix_transform.hpp"
abe732
source share