glm returning nan on simple translate

前端 未结 2 831
借酒劲吻你
借酒劲吻你 2020-12-04 03:22

I\'m tinkering with OpenGL using glfw, glad, and glm. In one of the tutorials I\'m using, they demonstrate some simple usage of glm as so:

glm::vec4 vec(1.0f         


        
2条回答
  •  既然无缘
    2020-12-04 04:05

    Answering my own question: though the tutorial and other sources said that glm would automatically instantiate an identity vector for

    glm::mat4 trans;
    

    it did not. Looking at a different tutorial, it seems that you can do so explicitly with

    glm::mat4 trans = glm::mat4(1.0f);
    

    And this solved the problem!

提交回复
热议问题