Skip to main content
gamedev.net
🔒 Locked

multiple lights

Started by Alina_85 Apr 1, 2009 at 11:32 AM 2 replies 950+ views
Original Post
Alina_85
Alina_85
Hello ! I have one question about lights. If I have a building with many rooms, how can I add a light(bulb) who lighting only one room (the other rooms remains obscure)? I mean that every room has their own light. Cheers !
Alina
Brother Bob
Brother Bob
When rendering a room, only turn on the light in that room.
Alina_85
Alina_85
But if I move from one room(1) to another(2), and I want to turn up the light in room 2 and turn off in room 1 when I press a key, how can I switch the lights ?
Alina
Brother Bob
Brother Bob
To change lights, use the glLight functions. If all you have is one light per room, then using GL_LIGHT0 and its parameters is sufficient. Before rendering a room, set its parameters with glLight. If this is not the problem, then I'm afraid I don't understand where the problem is.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.