I write some source codes to draw using OpenGL.
Some entitis are 2D, others are 3D. Here is my sample codes:
//initial, light is on.
glDisable(GL_LIGHTING);
…
draw 2d entities.
…
glEnable(GL_LIGHTING);
…
draw 3d entites.
…
I found there is not shading on 3D entities, why? Could anyone give me some suggestions?
Moving to the beginners forum.
– Tom
eror
3
Post your code which you are really using.
Are you sure you turn on proper lights?
The quick answer is to make sure you:
[ul][]Turn on appropriate lights (e.g. glEnable(GL_LIGHT0)[]Set light params appropriately. (e.g. glLight(…)[]Make sure you specify material settings (e.g. glMaterial(…)) []Make sure to specify normals appropriately. (e.g. glNormal(…))[/ul]
Thanks for hints, It is my program pitfall.