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 / Help positioning light...

Author
Message
BowserYo
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 2nd Oct 2009 21:47 Edited at: 2nd Oct 2009 22:05
Okay, I'm trying to get my light to flash at the players position when I shoot my gun. I have the flashing part working fine, but I cannot get the light to position itself correctly.

I don't think I am understanding how these commands work, this is how I am thinking.

I create a light
I set a point light
color light

(in the loop)
Position the light to players position

Here's my code:



It seems like the light gets brighter the closer I am to the coords 0,0,0. And the further away I am from that point it gets darker... I have NO idea whats going on...

Any else know what the problem is?

EDIT: Okay, it seems to only light up the ground near coords 0,0,0. It will still illuminate other objects around it, but that ground lighting up is my main desire!

ßõw§€r¥¤
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 3rd Oct 2009 16:01 Edited at: 3rd Oct 2009 16:02
Try calling SET POINT LIGHT in your loop and setting it to your player's position and then doing the same for POSITION LIGHT.

<-- Spell based team dueling game!
BowserYo
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 3rd Oct 2009 18:16
Okay, I've found that setting the point light to my position in the main loop causes two things to act differently:

1. My light cast shadows on enemy objects and power ups, but not the ground when you are more than probably 200 or so units away from 0,0,0. When you are at 0,0,0 then it cast light on the ground perfectly but quickly fades the farthur I move away.

When I only put the set point light at the start of my game, I can move all around the map and it will cast light on the ground and all objects perfectly but the light eminates from x=0,z=0. Doesn't seem to matter if the y value is 20 or so.


So is there another command I need to use to position or aim something else?!

Thanks!

ßõw§&#8364;r¥¤
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 3rd Oct 2009 20:40
I think it has to do with the vertices ( or polygon ) density of your ground object.
If vertices are far apart the light tends to fade away when not close to them.
Lower the matrix grid value in the example to 10 or 20 and you'll see the effect.

BowserYo
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 4th Oct 2009 01:26 Edited at: 4th Oct 2009 01:29
Exactly what the problem was Scorpyo.

Also, I did need to put the set point light in the main loop. Thank you guys!!

DBPro seems to render the lights on the edges of a model not the faces. Or rather, where four edges meet together on the point

ßõw§&#8364;r¥¤

Login to post a reply

Server time is: 2024-11-25 02:01:33
Your offset time is: 2024-11-25 02:01:33