Lighting Problem
I''ve been working on a rather complex model in OpenGL and until now I wasn''t useing lighting. now when I add the following lines It turns all my colors into different shades of white(gray). If anyone has any ideas please let me know!
GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f };
GLfloat LightDiffuse[]= { 1.0f, 1.0f, 1.0f, 1.0f };
GLfloat LightPosition[]= { 0.0f, 0.0f, 0.0f, 1.0f };
glEnable(GL_LIGHTING);
glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse);
glLightfv(GL_LIGHT1, GL_POSITION,LightPosition);
glEnable(GL_LIGHT1);
------------------------------Piggies, I need more piggies![pig][pig][pig][pig][pig][pig]------------------------------Do not invoke the wrath of the Irken elite. [flaming]
check out the faq http://www.frii.com/~martz/oglfaq/ see lighting and materials
http://members.xoom.com/myBollux
http://members.xoom.com/myBollux
October 16, 2000 06:04 PM
Thanks for the effort anyway. I found that the error was that GL_COLOR_MATERIAL was apperantly being disabled somewhere between the initialazation and drawing functions. It''s probably in one of the functions I''m using from other people, I''m rewriting everything so it''ll all be my code with just what I need when I''m done. For now I''ll just have to keep a call to glEnable(GL_COLOR_MATERIAL) at the begining of my drawing function. You can see the result of my work so far (on this project) at http://tannara.2y.net/
I think, that the biggest problem is
that you dont have normals defined
for you polygons in the model.
If you dont know how to do this mail me
on dave007@volny.cz.
Dave
that you dont have normals defined
for you polygons in the model.
If you dont know how to do this mail me
on dave007@volny.cz.
Dave
--------Dave[ Math Studio ] A Computer Algebra System
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement