Archived

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

DanG

OpenGL OpenGL Lighting Problem

Recommended Posts

I am a bewginner with a project going that involves lighting and texturing an object. When i have lighting off the object appears nicely, all textured. When i turn on lighting the object disapears. I have gone back and checked all the code and found no problems. I used the glGetLight*, glGetMaterial*, glIsEnabled, and so fourth and they show that everything is set up the way i want it. I''m assuming my values are not working correct, such as my attenuation factors or light direction, but looking through my references they all look legal. Does anyone know what might be causing this problem? Here are the values i use, they are very simple. the Material (RGBA) GL_AMBIENT - 0,1,1,1 GL_SPECULAR - 0,1,1,1 GL_DIFFUSE - 0,1,1,1 GL_SHININESS - 100 the Light GL_AMBIENT - 1,1,1,1 (spec and diffuse the same) - 1,1,1,1 GL_POSITION - 0,0,0,1 GL_SPOT_DIRECTION - 0,0,1 GL_SPOT_CUTOFF - 45 GL_SPOT_EXPONENT - 0 GL_CONSTANT_ATTENUATION - 1 GL_LINEAR_ATTENUATION - 0 GL_QUADRATIC_ATTENUATION - 0 Could there be a conflict in these values? BTW the object is centered at 0,0,-7 and the eye is at the origen. He who said money was the root of all evil knew little of the nature of money and less about the nature of man.

Share this post


Link to post
Share on other sites
Yes i have, they are automatically genereated and are perfect, thanks for responding though.

He who said money was the root of all evil knew little of the nature of money and less about the nature of man.

Share this post


Link to post
Share on other sites
There has been a change now.

I changed the material properties to make it a mostly red material, IT APPEARED. If the material is all red the object, now just a glutSolidTeapot, can be seen it all its glory. however as soon as you drop the red compnent you lose the whole object. for example, when you change the abient to no red and all blue, everything disapears except for the highlights which are affected by the specular''s red componenet. What could be causing this problem? ALl responses appreciated.

He who said money was the root of all evil knew little of the nature of money and less about the nature of man.

Share this post


Link to post
Share on other sites
Alright, i resolved this particular problem. I''ve changed what must be happening, you can see the post above here for the new problem. Go ahead and let this one die

He who said money was the root of all evil knew little of the nature of money and less about the nature of man.

Share this post


Link to post
Share on other sites