I have the following code:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); glTranslatef(.03f * state, 0.0f, 0.0f); state = 0; glDrawArrays(GL_TRIANGLES, 0, LOC); glPopMatrix();
I pop the matrix at the end so that I can apply a different transformation to a different part of the array. The problem is, when
glPopMatrix() is present at the end of this code, the object drawn keeps wiggling instead of moving like its supposed to.
Note: State is set somewhere out of the loop and does not cause the draw function to stop working (as the function works without glPopMatrix()).