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.

DarkBASIC Professional Discussion / The Sky Sphere's Brother - The Sun Glare. Help needed.

Author
Message
Amadeus
23
Years of Service
User Offline
Joined: 20th Apr 2003
Location: United States
Posted: 23rd May 2003 21:04
Hello again everybody, and a thanks to everyone who's helped me get this far. Now that I'm working on implementing more realistic environments, I was thinking about putting in a sun object and, by looking at it directly, it would cast a glare object as well, similar to Strut Your Stuff, by Mr. Akuma, when aiming the gun to the sun. I suppose the only way to ask this question intelligently is by first asking how to move the camera in the Quake/FPS style, that is, by moving the mouse around, it re-focuses the direction of the camera (tilt up, tilt down, etc.) - I've tried using the pitch up, down routines, but they are fixed on the world coords and not the camera's, so if I turned the camera with the left or right button, the pitch up looks quite odd, to say the least. The only thing I have been able to figure myself in this matter, is a check for the ground level of the matrix and then constant repositioning of the camera to the hieght of the matrix + 230 (The standard height of my characters). From this state, then I could ask how to put in the glare, or at least a reference to where I might find some source code. I've had some ideas about it, but I'm not a good trigonometry person, and sincostan is not exactlly my trade. Any help supplied would be greatly appreciated. Thank You Again for your time,

Sincerely,
Drew
Life is a tale told by an idoit, full of sound and fury, signifying nothing. - MacBeth
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 23rd May 2003 22:28
For FPS control, you could try this:

inc mx#,mousemovey()
inc my#,mousemovex()

rotate camera mx#,my#,0

for the mouselook and this foer the strafing:

if leftkey()=1

turn camera left 90
move camera 10
turn camera right 90

and the exact reverse for right.

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 23rd May 2003 22:30
As for the glare, you could make a plain, texture it with a sun image, ghost it them position it where your sun is and poitnb this object at the camera. This will create the effect of a sun glare.

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 23rd May 2003 22:31 Edited at: 23rd May 2003 22:32
I have an idea:

1. Record users' current angles
2. Use POINT CAMERA to point the camera at the sun object
3. Record camera angles
4. Set camera angles back to the ones in step 1
5. Compare the angle differences between steps 1 and 3. If they are small, then the camera wasn't moved much by step 2, so the camera is pointed at the sun - therefore show the glare object.

As for glare object, create a plain (ghosted with glare texture) in the same position and with the same orientation as the camera, move it towards the camera slightly.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_102.zip
The Darthster
23
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 23rd May 2003 22:34
Here's the code for fps style movement, including mouselook and strafing:



I don't have any source code for a lens flare, but you might try starting off with a hidden object where the sun is, then using object screen x() and object screen y(), and using that in conjunction with the x and y coordinates of the centre of the screen.

Once I was but the learner,
now, I am the Master.
Firesea
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location:
Posted: 24th May 2003 00:39
http://gamedevnetwork.com/article.php?aid=2#

Great article on making a lens flare!!
Jones 205
23
Years of Service
User Offline
Joined: 15th May 2003
Location:
Posted: 24th May 2003 01:19
Usefull Lens Flare Turorial on gamedevnetwork.com
http://gamedevnetwork.com/article.php?aid=2

Login to post a reply

Server time is: 2026-07-11 13:58:08
Your offset time is: 2026-07-11 13:58:08