Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Wed Jun 19, 2013 1:28 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Ground-level light source
PostPosted: Thu Aug 09, 2012 2:10 am 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
I have a carry-able lantern that lights up rooms:
Image

However, when I drop the lantern, the ground receives no lighting:
Image

This seems to be the same situation as when you stand next to the wall while holding the flashlight: you're too close to the wall, and so the wall receives no illumination.

Does anyone have a way for the ground to still receive illumination, even when the light source is directly resting on it?


Top
 Profile E-mail  
 
 Post subject: Re: Ground-level light source
PostPosted: Thu Aug 09, 2012 10:54 am 
Offline
did just hit his 750th monster

Joined: Tue Jul 05, 2005 3:15 pm
Posts: 824
Location: Adelaide - Australia
The easiest method would probably just be to offset the position of the light source, so that it is positioned a short distance (say 16 units) above the lantern.


Top
 Profile  
 
 Post subject: Re: Ground-level light source
PostPosted: Thu Aug 09, 2012 5:24 pm 
Offline
fired 300 rounds
User avatar

Joined: Sat Jun 28, 2008 2:17 pm
Posts: 350
That won't work: if it falls on the face in the direction the lamp is offset, the lamp will be under the floor.

_________________
"John Carmack needs to use more emoticons to get his message across."


Top
 Profile E-mail  
 
 Post subject: Re: Ground-level light source
PostPosted: Thu Aug 09, 2012 6:16 pm 
Offline
picked up 75 health

Joined: Thu Aug 19, 2004 3:50 am
Posts: 81
Thanks for the tips. I wrote a "think" function that constantly repositions the light source above the lantern:
Code:
   void weapon_lantern_world::thinking()
   {
      while(1)
      {
         if (!$player1.isHolding( self )) //check if the lantern is being held.
         {
            _light.unbind(); //unbind the lightsource from the lantern.
            
            //position the lightsource 24 units above the lantern.
            sys.tracePoint (self.getOrigin(), self.getOrigin() + '0 0 24', MASK_SOLID, self);         
            vector lightpos = sys.getTraceEndPos();   
            _light.setAngles( self.getAngles() );
            _light.setOrigin( lightpos );
         }
         
         sys.waitFrame();
      }
   }

And here's how it looks like in-game:
Image


Top
 Profile E-mail  
 
 Post subject: Re: Ground-level light source
PostPosted: Fri Aug 10, 2012 4:18 am 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 7096
Location: Here, not there.
You could just make a bigger clip model around the mesh.

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group