I'm not an opengl expert, and, as a novice, I prefer to practice a little bit with the old opengl just to be sure to understand correctly the basic concept of computer graphics before deal with shaders and modern opengl (3.x). I don't want to start a flame with this so I'll go through my question. I just know that what I'm using is deprecated.
What I wanto to render is this:
and I'm drawing it using this piece of code:
// draw grid drawGrid(10, 1); // draw a teapot glPushMatrix(); glTranslatef(modelPosition, modelPosition, modelPosition); glRotatef(modelAngle, 1, 0, 0); glRotatef(modelAngle, 0, 1, 0); glRotatef(modelAngle, 0, 0, 1); drawAxis(4); drawTeapot(); glPopMatrix();
Now, I'd like to replace the last
glRotatef with matrixes, and I'm doing in this way:
Matrix4 _matrixModel; _matrixModel.identity(); _matrixModel.translate(modelPosition, modelPosition, modelPosition); _matrixModel.rotateX(modelAngle); _matrixModel.rotateY(modelAngle); _matrixModel.rotateZ(modelAngle); glLoadMatrixf(_matrixModel.getTranspose());
And I don't see anymore the teapot. So I thought that this _matrixModel is not complete because it is only the model matrix and I need a modelview so I have to multiply it with the projection matrix but.. this is what I get:
where am I wrong?