OpenGL, model matrix as no rotation/translation/scale
I am playing with opnegl (the old one, sorry for the modern opengl guys),
and I'm trying to understand the matrixes and replace glRotatef,
glTranslatef etc with glLoadMatrixf.
I don't understand how to set a matrix with no rotation, no translation,
no scale. I thought I could use an identity matrix but it doesn't work.
I'd like to have a matrix such that writing:
glPushMatrix();
{
drawMyCube();
}
glPopMatrix();
is the equivalent to writing:
glPushMatrix();
{
glLoadMatrixf( myCubeTransform.getTranspose() );
drawMyCube();
}
glPopMatrix();
If I have something like:
/* 1: */ // glLoadMatrixf( myCubeTransform.getTranspose() );
/* 2: */ // glLoadIdentity();
In the first place I thought to use myCubeTranform Matrix4 class (and I'm
using a row-major order matrix class so I have to getTranspose() to match
opengl column-major order) but it doesn't work, so I used glLoadIdentity
to be sure to does not make mess with my Matrix4 class (some bug in matrix
code?) and.. it doesn't work either.
So my question: how to set a transform matrix with no translation, no
rotation, no scale?
No comments:
Post a Comment