modern OpenGl transformation issues

  3d, c++, glm-math, opengl-3, rotation

i have an object i am trying to apply some transformation, something like an airplane, if i translate the object it translate normaly but if i try rotating it at its current position after translating it, it still rotate around the initial origin.

i dont really know if the order of my transformation matrix is the issue.

m_Model = mat4(1.f);

//m_Model = translate(m_Model, -this->position);
m_Model = rotate(m_Model, radians(this->rotation.x), vec3(1.f, 0.f, 0.f));
m_Model = rotate(m_Model, radians(this->rotation.y), vec3(0.f, 1.f, 0.f));
m_Model = rotate(m_Model, radians(this->rotation.z), vec3(0.f, 0.f, 1.f));
m_Model = translate(m_Model, this->position);
m_Model = glm::scale(m_Model, this->scale);    

Source: Windows Questions C++

LEAVE A COMMENT