Well I have a lot of OpenGl questions so I hope someone can help me out here. Oh and I’m learning OpenGl thru http://nehe.gamedev.net/ if that should make a difference
1. Can the lighting be changed at all after it was initialized? Like the position, color etc.
2. Using glColor3f(1.0f,0.0f,0.0f); how would I limit to what it affects? For example
Code:
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 View
glTranslatef(0.0f,0.0f,-10.0f);
glBindTexture(GL_TEXTURE_2D, texture[0]); // Select A Texture Based On filter
glBegin(GL_QUADS); // Start Drawing Quads
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f); // Point 1 (Front)
glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f); // Point 2 (Front)
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f); // Point 3 (Front)
glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f); // Point 4 (Front)
glEnd(); // Done Drawing Quads
glColor3f(1.0f,0.0f,0.0f);
glPrint("NAH A HSJKLTSRAO!!#@#$@%)$_"); // Draw A Skull And Crossbones Symbol
return TRUE; // Keep Going
}
I don't understand why the glColor3f affects the quad when its after it...
3. Using glNormal3f( 0.0f, 0.0f, 1.0f); it finds out where the center of the object is by itself? What if it’s on a slant like a pyramid would it matter? Or you accidentally go over like if the object is located at 0.0f,0.0f,0.0f,1.0f and you use glNormal3f( 0.0f, 0.0f, 2.0f);
4. How does glColor4ub work? I never really understood the mechanics…
5. Does minimapping take more cpu power or less then linear mapping?
6. Also how would you load multiple image files/textures? Or reload them later in the programming for example you walk through a portal and now your in a new town etc.
7. Last thing how do transparent images work in Opengl? I need to be able to make some parts of an image transparent but I’m not sure how to go about doing this.
8. Know any good books to learn opengl?