int RenderScene(GLvoid)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
Camera.LookAt();
DrawFloor(); //Draw a floor than texture it
DrawGLRect(45.0f,y1Pos); //Draw a 3D rect than texture it
DrawGLRect(-47.0f,y2Pos); //same
glPushMatrix();
glTranslatef(xSpeed, ySpeed, 0.0f);
DrawSphere();
glPopMatrix(); // room will not move
DrawRoom();//mess up the entire scene!!!!!!!!!!!!!!!!!!!!!!
// DrawRoom will be blended when I fixed
// the problem
return TRUE;
}
void DrawRoom()
{
glBegin(GL_QUADS);
//psuedo
setColor(red)
do the drawing thing
glEnd();
}
new to opengl: question about colors
Hi,
I''m stuck with a simple color problem:
DrawRoom color''s spills over to my Floor and Rectangles,
so what you get is a textured floor + red.
Putting DrawRoom in the beginning of RenderScene also messed
the entire thing up!!! any suggestions??
I''m guessing here that you want the floor to be textures AND red an the rest should be normally textured. Quite simple.
After you use a glColor4f (or whatever variant you use) and you draw the room, call glColor4f again with all 1.0f to reset the colors back to normal.
Sander Maréchal
[Lone Wolves Production][Articles][GD Emporium][E-mail]
After you use a glColor4f (or whatever variant you use) and you draw the room, call glColor4f again with all 1.0f to reset the colors back to normal.
Sander Maréchal
[Lone Wolves Production][Articles][GD Emporium][E-mail]
You can also use glPushAttrib(GL_CURRENT_BIT) before you draw the floor and then use glPopAttrib() to restore the color.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement