- What is a polygon mesh?
Exactly what is sounds like, a mesh of polygons. It can be a collection of individual triangles/quads/generic polygons or more commonly a collection of triangle strips. Think along the lines of a terrain in a game. Most would be implemented as meshes of triangles.
- how can i control the thickness of a polygon?
You don’t. Polygons like triangles are infinitesimally thin, like in mathematics. Of course, you can build a thick polygon, like a cube, from several thin ones. There is one rendering mode (glBegin(GL_POLYGON)) that can build arbitrary polygons, but they must be convex, and it is better to use triangles anyway.
- I’m quite confused on the glTranslate. I read a book on glTranslate saying “it translates for x,y,z not to x,y,z” what exactly does this means?
Dunno. glTranslate*(TYPE x, TYPE y, TYPE z) multiplies the current (modelview) matrix by a translation matrix. It has the same effect as moving an object on screen by x, y and z. For example, if you have an object at (0, 0, 0) and you call glTranslatef(2.0f, 0.0f, 0.0f); the object will then be at the position (2, 0, 0). If you follow that with a call to glTranslatef(0.0f, 1.0f, 0.0f); the object will be at the point (2.0f, 1.0f, 0.0f). Is that what you mean? glTranslate() translates relative to the current position, not to an absolute position.
- why is it that whenever i does a rotation on my polygon, the other end of the polygon runs out of the screen? (think if i understand translate, maybe i can figure this out?).
I’m guessing you’re maybe translating first, then rotating second? What do you want to do, rotate a polygon on the spot (around its axis) at a specific location? Or rotate around a specific location, like a planet in orbit? Here’s some pseudocode for a rotating planet orbiting some central sun:
glRotatef(orbit_amount, x_orbit, y_orbit, z_orbit);
glTranslatef(planet_x, planet_y, planet_z);
glRotatef(rotation_amount, x_rotation, y_rotation, z_rotation);
I think that’s right. Someone will correct me if it’s not. I am always confused (like a lot of people) with OpenGL’s transformation order. I learnt linear algebra as part of my undergrad course and the mathematical order is the opposite to OpenGL’s. I hope this is right: I usually try to think of the transformations in the reverse order to which they are performed. So in the above example, reading from bottom to top, you draw the planet, rotate it on the spot, translate it outwards into its orbit, then rotate around the orbit.
Anyway, the best way to learn is to experiment with simple examples until you understand what happens.
Hope that helped