Archived

This topic is now archived and is closed to further replies.

Marky B

Probs with lighting

Recommended Posts

Marky B    122
Hi Have just started using openGL in Visual c++. I have used it a reasonable amount in Fortran95 but have never come across this problem before. ive got a couple of spheres, which are coloured red(1.0, 0.0, 0.0), i have put one in the sceen and enabled ambient and difuse lighting. when i GLenable the lighting, the shading on the spheres works perfectly but they are greyscale rather than red, if i turn the lighting off they go back to red. does anyone know of an answer to the prob as im flumoxed??

Share this post


Link to post
Share on other sites
OrangyTang    1298
Are you setting the red colour via glcolor*() calls? If so you''ll need to glenable(GL_COLOR_MATERIAL) to use the per-vertex colours. Otherwise you have to set a material (with colours for ambient, diffuse and specular, default all white).

Share this post


Link to post
Share on other sites
Marky B    122
Orangy Tang you are a wonderfull person

ta for that it works like a dream, i have even coloured the spheres orange in honor of you sving me hours of trrawling through books and stuff

Ta again

Mark

Share this post


Link to post
Share on other sites