PDA

View Full Version : help, i'm stuck



Ronan
11-21-2001, 07:20 AM
In an application i am working on, i would like to draw some simple polygons, two triangles and two rectangles to be precise. i would like to colour one of each red, and the others green.

i have one tiny problem with this whole thing: it won't work.
i do the glBegin for each polygon, call glColor, then glVertex for each corner, then glEnd, and the same for the other polygons.

unfortunately, my colour instructions are being completely ignored, and all four polygons are being drawn a crappy brown colour, which is used previously in the program.

i have no idea why it won't work, and and suggestions are welcome, especially if they help me fix the program.

cheers

pythagoras
11-21-2001, 08:30 AM
code please

marysowdha
11-21-2001, 09:40 AM
try to change the color settings of your monitor,

send the code also

Kaycee
11-21-2001, 10:37 AM
Make sure lighting is off. If you have it on and your material is set to brown then most likely that is your problem. If you want lighting on then you will have to change your material to the color you want or you can enable color material, glEnable( GL_COLOR_MATERIAL ) in order for glColor functions to change the material.

MrShoe
11-21-2001, 06:59 PM
Make sure you did the following:
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
and disable Lighting....

Ronan
11-22-2001, 12:38 AM
THanks folks for all the suggestions, but the winner is Kaycee and the colour material suggestion.

It now works brilliantly, and might explain other problems i was having earlier.

thanks again
ronan