Try the OpenGL Programming Guide also called the red book. You can read it for free over the internet. Well, as far as 3D transformations go, either explicitly create a 4x4 matrix and fill it with numbers, or use an api function where you give the rotation angle in radians or degrees, and the axis that you want to rotate the point around. Basically, all of your vertices are multiplied by the matrix and are displayed on the screen.

In OpenGL:

glPushMatrix();

glBegin(GL_TRIANGLES);

glVertex3f(0.0f, 0.0f, 0.0f);

glVertex3f(2.0f, 2.0f, 0.0f);

glVertex3f(4.0f, 0.0f, 0.0f);

glEnd();

glPopMatrix();

This creates a triangle with lower left corner in the middle of the screen which is x=y=z=0. In OpenGL you have a matrix stack, that contains a 4x4 matrix and is called the current matrix. When you call the glPushMatrix() you make a copy of the matrix that's on the first level of the stack and it will be written to the second level of the stack and becomes the current matrix. Let's say I am creating a 3D cube, so I write a code that draws one face of the cube. Then copy the current matrix to second level, since the first level matrix already contains values that specify your view and projection. I rotate the new quad face with glRotatef(90.0f, 0.0f, 1.0f, 0.0f) around y-axis (that's the 1.0f that I tell OpenGL to rotate the face counter clockwise) then I use glTranslatef(-2.0f, 0.0f, 0.0f) to move the rotated face 2 feet to the left(negative x-axis). The rotation occured around one fixed world coordinate system with its center at x=y=z=0. So the order of operation would be:

1) glPushMatrix()

2) do glTranslate*() call

3) do glRotate*() call

4) glBegin()

.... glVertex*() stuff

5) glEnd()

6) glPopMatrix()

Next

1) do same

2) go 2 feet to the right i.e. positive x-axis

3) rotate -90 deg clockwise

4) draw second face

5) same

6) same

OpenGL will issue glRotate* and glTranslate* in reverse, so the matrices are generated by OpenGL first, i.e. rotation happens first then movement along negative x axis is second. The current matrix contains view and projection values, so you don't want to change this, therefore issue glPushMatrix() to make a copy, then OpenGL creates a translation matrix which is left multiplied by current matrix, then OpenGL creates rotation matrix which is also left multiplied by now view, projection, translate matrix, then your matrix becomes a convoulted mess with view, projection, translation, and rotation values all multiplied together, and after that your vertices are multiplied by this current 2nd level matrix. After translated and rotated vertices of the first face are send to the card, then the 2nd level matrix is destroyed by OpenGL and you remain again at center x=0, y=0, z=0, and current matrix stack contains view and projection values only. Then second face is drawn and you're back to center again. You can also draw 3D cube without rotation or translation and without glPushMatrix and glPopMatrix, but that way you have to really draw the cube in 3D with different values for each vertex, since each face is oriented differently in 3D scene, instead here I drew only one face and moved it and rotated it to position(I am reusing the same vertices for the next three faces). To recap, under OpenGL you tell the api what primitive you want to draw with glBegin(GL_TRIANGLES), then you specify the right amount of vertices, in this case 3 since it's a triangle, then use glEnd() to tell the api that you're done specifying vertices, then you call glFlush() to send data to the video card, and then you swap the back buffer where your triangle is rendered to the front buffer which the video card scans and sends output to your monitor. Hope this will help you. Good luck