Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Hey, a question about light

Author
Message
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 23rd Apr 2008 04:20
I am trying to make a multiplayer game that is like hide and seek-- a little dumb... I know...

How would I get ti so that a light is right in front of every person and the light moves with them? This is so they can only see a bit ahead of them.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 23rd Apr 2008 09:53
Continuously position a light ahead of the camera by say around 20 units with the Y a little more than the Y of the camera so that it is in the air.

So, it may look something like this:
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd Apr 2008 14:20
Also - try using light 1 not Light Zero for this moving around. I found (and others have also) Light Zero doesn't always play nice.

I was trying to get normals right on a mesh - (so the light would look right) I was pulling my hair out. Someone said try light 1 instead, so I dimmed out light 0 to nothing and used light 1 ...WHOA! It WAS FINE ALL ALONG! (the normals) it was the light!

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 23rd Apr 2008 16:10 Edited at: 23rd Apr 2008 16:10
The code I posted earlier does not take into account rotation of the camera, it only works if the camera is not rotated. The following code gives a torch effect; imagine that you are looking through the eyes of a person holding a torch (or if you prefer, a person with a very bright face ). This works regardless of camera rotation:

programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 23rd Apr 2008 16:37
thanks to everyone that could help!

Login to post a reply

Server time is: 2024-11-20 07:30:13
Your offset time is: 2024-11-20 07:30:13