Colored background with smooth transition

Hi,

Does anybody know how to define a smooth transition colored background instead of a constant colored background?

By transition I mean like the one you can see in some CAD packages. You can choose any two colors, one for the top and other for the bottom and there is a transition between them presented on screen.

Thanks.

Draw a square to cover the screen, set color1 for the upper two vertex, and color2 for the bottom two vertex. set glShadeModel(GL_SMOOTH). that will do.

I just need to maintain this square centered in the screen with vertexes corresponding to window coordinates.

Thanks.

That sounds like a good idea.

Yesterday I posted some code for having a background bitmap:
http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/002780.html

It is the same thing for your effect (except that you do not texture the quad and specify one color per vertex…).

Regards.

Eric