Hello!
I am trying to port tutorial #11 from ogldev to use glm, but something is not okay.
Original code:
Pipeline p;
p.Scale(sinf(Scale * 0.1f), sinf(Scale * 0.1f), sinf(Scale * 0.1f));
p.WorldPos(sinf(Scale), 0.0f, 0.0f);
p.Rotate(sinf(Scale) * 90.0f, sinf(Scale) * 90.0f, sinf(Scale) * 90.0f);
glUniformMatrix4fv(gWorldLocation, 1, GL_TRUE, (const GLfloat*)p.GetWorldTrans());
My attempt to port it:
glm::mat4 scale = glm::scale(glm::mat4(1.0f), glm::vec3(sinf(i * 0.1f)));
glm::mat4 translate = glm::translate(glm::mat4(1.0f), glm::vec3(sinf(i), 0.0f, 0.0f));
glm::mat4 rotate = glm::rotate(glm::mat4(1.0f), sinf(i) * 90.0f, glm::vec3(1.0f, 1.0f, 1.0f));
glm::mat4 model = translate * rotate * scale;
glUniformMatrix4fv(hWorld, 1, GL_FALSE, glm::value_ptr(model));
But something I must be doing wrong.