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.

Newcomers DBPro Corner / Torch light

Author
Message
Tristan
20
Years of Service
User Offline
Joined: 18th May 2004
Location:
Posted: 15th Jul 2004 05:11
I am having trouble getting a light to attach to the camera so I can walk around with light like a torch. Can anyone help?
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 15th Jul 2004 13:46
Just use this command to place a light exactly at the camera's location:

position light lightnum,camera position x(),camera position y(),camera position z()


Just place this in your main game loop and replace lightnum with the number of the light that you want at the camera's position. If you can't see the light, make sure it is a point light, or a spot light pointing in front of the camera. Also, make sure it is colored bright enough.

Anything else?

Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
[href][/href]
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 15th Jul 2004 13:55
Yeah, you need to define the "cone" of the light, place it behind the camera, and point it in front. Also might have to hide the ambient light as well, or reduce its brightness enough to see the torch.

Any truly great code should be indisguishable from magic.
Tristan
20
Years of Service
User Offline
Joined: 18th May 2004
Location:
Posted: 16th Jul 2004 05:11
Thanks for all the help. I have got the torch moving around well. Can anyone tell me how I can make the light brighter? I have included my code so far.
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 16th Jul 2004 06:58
Hmm... I believe you're looking for the SET LIGHT RANGE command, which determines how far the light reaches away from its source position. The default values is 3000 units. If there is another for general brightness, I don't know it.

Any truly great code should be indisguishable from magic.
Tristan
20
Years of Service
User Offline
Joined: 18th May 2004
Location:
Posted: 17th Jul 2004 07:00
Thanks for the help, the torch is working great

Login to post a reply

Server time is: 2024-09-22 16:21:08
Your offset time is: 2024-09-22 16:21:08