Path: chuka.playstation.co.uk!news From: "Mario Wynands" Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: 3d lights, distance, movement Date: Wed, 10 Feb 1999 10:39:25 +1300 Organization: Sidhe Interactive Lines: 47 Message-ID: <79q9fh$1do7@chuka.playstation.co.uk> References: <01be5457$ab8a2d40$813770c2@RikPrince> NNTP-Posting-Host: p15-max8.wlg.ihug.co.nz X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Rikki Prince wrote in message <01be5457$ab8a2d40$813770c2@RikPrince>... >I'm currently designing a game in which I want to have a first person >perspective with a light above the head of the person, all of the time. >Also, I only want the light to shine a certain distance, so the player can >only see a few metres ahead. As well as this I wish to make the intensity >of the light variable, so as power decreases, the light dims. >I've got a basic idea of how to keep the light place constant: mainly, move >the world in relation to the person and light. However, I believe this >already happens (according to James Russell's Matrix tutorial I read). >Could anyone tell me if these things are possible, and maybe how to do >them? Hi Rikki, Although you can't do this directly (because the libs don't support it) you could probably get a reasonable result using a combination of fog and parallel lights. As your game is first person you can set up the fog so it fades out to black, with the point where it totally fades out being the maximum distance you want your player to see (you can vary this over time as well). Then set up a flat light pointing forward and slightly down in relation to the player (must be recalculated every frame if your player moves around the world and as flat lights are set up in world coordinates). This combination should give you something close to what you are after. The parallel lighting won't look quite right but it might be good enough for your needs. If you wanted to be really flash you could get a better result by using the combination as above but just before you sort each object into the ordering table, calculate the angle between that object and the top of the players head. Then change the flat light direction to match. This will look like the light is emanating from a point a bit more. Hope this helps Mario Wynands Sidhe Interactive Sony Playstation Software Development House Email mario@sidhe.co.nz Website www.sidhe.co.nz