Hey all, I'm a beginner here so bear with me. As far as I understand it when you push a new matrix on it's kinda like creating a copy of your current scene and then you can act accordingly and then you can pop it off and be left your original scene. (this may be wrong, please correct me if so) What I don't get is how come this code:
Code ://position is an array of random values, this is a while loop which goes through all the points and creates a cube glPushMatrix(); glTranslated(-positionx[i], -positiony[i] - 3, -positionz[i]); //translate the cube glColor3f (1.0f, 0.0f, 0.0f); glutSolidCube(2); //draw the cube glPopMatrix();
doesn't work without the push and pop of the matrix. Could someone clarify this for me? Thanks!