Original Post
Just started with opengl in class. Was wondering why when I use the rotatef function, and then translate (for example in asteroids), instead of the rotation point changing WITH my object, it stays at the center of the screen. This means when I move the object anywhere from the center, instead of turning in place, it is swung around the center of the screen like a lasso. int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer glLoadIdentity(); // Reset The Modelview Matrix glTranslatef(0.0f,0.0f, -6.0f); // Move Left And Into The Screen glRotatef(rtriz,0.0f,0.0f,200.0f); // Rotate The Cube On X, Y & Z glTranslatef(mtrix,mtriy, 0.0f); DrawTriangle(); return TRUE; // Keep Going } ....... while(!done) // Loop That Runs While done=FALSE { if(keys['D']) { rtriz-=5; ptrix = mtrix; ptriy = mtriy; ptriz = mtriz; } if(keys['A']) { rtriz+=5; ptrix = mtrix; ptriy = mtriy; ptriz = mtriz; } if(keys['W']) { mtriy-=.01; } if(keys['S']) { mtriy+=.01; }