I got another question I am trying to draw a 3D scene with a single light enabled, switch to ortho mode, draw a menu with a different light shining on it, and then switch back to perspective mode. However, I cannot seem to get the light to shine on the menu at all (except at random positions in the world, where I assume it is getting light from the first source)? Does anyone happen to have any pseudo code/ideas as to how I might go about doing this (I am mainly concerned with the ordering of operations)? I am not sure if I should enable/position the second light before or after I have switched into ortho mode, and I am unsure if when in ortho mode, the light position should be in screen pixels or in the usual relative units. I appologize if I have explained this unclearly. Any help would be appreciated, though.
does the menu really have to be lit? it might be better just to disable lighting entirely, draw the menu, and enable lighting again. if you need to do it the way you described, try disabling the single light that is in your scene before you draw the menu, but make sure that you enable it again when you draw the next frame
Heh… no, I suppose it does not have to be lit. But I was hoping to constantly pan the light across the menu for a visually stimulating effect. Only problem it, I can get no effect to appear!
Do you have correct normals specified when drawing your menu?
I have enabled GL_NORMALIZE. Shouldn’t that generate the appropriate normals for me? I thought that it would, as currently I have none defined explicitly.
No it doesn’t. You have to send them yourself. Enabling normalization tells OpenGL to make sure your normals are of length 1.0 when calculating lighting. This can cure problems you get when your modelview matrix introduces scaling of the normals you send.