I\'m working on a small graphics engine using OpenGL and I\'m having some issues with my translation matrix. I\'m using OpenGL 3.3, GLSL and C++. The situation is this: I ha
You cannot swap matrices in a matrix multiplication, so A*B is different from B*A. You have to transpose B before swapping the matrices.
A * B = t(B) * A
try
void DisplayObject::updateMatrices()
{
modelMatrix = identityMatrix();
modelMatrix = translateMatrix( xPos, yPos, zPos ) * modelMatrix;
/* update modelview-projection matrix */
mvpMatrix = modelMatrix * (*projMatrix);
}