Centering a Polygon

Help Please! I am a beginner with OpenGL and I am quite happy with what I’ve been able to accomplish so far. However, there is one simple problem that has me stumped!

I have a polygon with 3 vertices (could be anywhere, not necessarily centered at the origin). I know the coordinates of the 3 vertices and the surface normal.

Question: How do I center the polygon in the middle of the screen with the surface normal pointing towards the user?

I’ve tried gluLookAt, but I can’t seem to get it right. Can anyone tell me what calls I need to make and in what order? I have a feeling I’m very close but I’m just missing some small piece.

Thank you in advance!

Try the following code:

gluLookAt (0, 0, 10, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
// glTranslatef( 0, 0, -12 ); It is the same effect

float size = 1.0;
glVertex3f(-size, -size, 0.0);
glVertex3f( size, -size, 0.0);
glVertex3f( size, size, 0.0);

It should be so easy as I have written. Try to understand better gluLookAt looking this link