Im relatively new to working with OpenGL and OpenGL matrices, and my code is currently not doing what I would expect it to. Ive looked through OpenGL docs and some online examples and I just cant get this to work as I think it should.
Basically Ive set up a tranform class that holds a 4x4 matrix in a linear array. I want to have functions in this class that manipulate the matrix via OpenGL functions. Ive simplified my code down to whats below. According to this code I would expect the console to output a bunch of different numbers, but instead it outputs the oirginal matrix (1, 1, 1, …).
Any help or advice would be appreciated. Thanks.
float matrixTest[16] = {1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f};
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadMatrixf(matrixTest);
glScalef(20.0f, 20.0f, 20.0f);
glRotatef(20.0f, 3.0f, 3.0f, 3.0f);
glGetFloatv(GL_MODELVIEW_MATRIX, matrixTest);
glPopMatrix();
for (int i = 0; i < 16; i++){
cout << matrixTest[i];
}
Edit/Delete Message