Lighting Problem

Started by
1 comment, last by MeeZ 20 years, 6 months ago
Hi There, I am currently working on my first game, a tetris clone, and I am trying to implement lighting. I have Outlined Fonts for displaynig scores etc... And for when I enable lighting the faces of the text appear lit, and those faces not in line with the light source appear shaded. This is fine. This is the effect I want for the CUBES I have on my screen for the tetris pieces etc... When I draw each face of a cube, I add glNormal3f(x, y, z) prior to drawing the vertices of the QUADS. But I do not get the lighting effect that I get with the text. Each face of the cubes appear to be as bright as the next, they are constantly bright, there is no shading at all. Why is this? Can anyone out there help me out. This is really bugging me! Hope you can help. Thanks for your time. Cheers, MeeZ
MeeZ
Advertisement
you probably have a misplaced call to either glEnable(GL_LIGHTING) or glDisable(GL_LIGHTING). make your calls as such:

gameLoop {    glEnable(GL_LIGHTING);    //render your cubes and whatnot    glDisable(GL_LIGHTING);    //render your text} 
Palidine,

Thanks for your suggestion. Unfortunately however that doesn''t solve my problem. Could it have something to do with position of light, light type etc.. I''m pretty new to lighting. But thatnks for trying anyway!

Cheers,

MeeZ
MeeZ

This topic is closed to new replies.

Advertisement