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 Discussion / Lens flare help please

Author
Message
Aramil
21
Years of Service
User Offline
Joined: 27th Oct 2003
Location: Wherever my feet take me
Posted: 1st Aug 2004 02:55
Okay...I'm still working on Space Havoc 3
In this game, I have a sun. Wow. My lens flare effect is like this:

SXDis#=320-object screen x([sun])
SYDis#=240-object screen y([sun])
SDistance#=SXDis#+SYDis#
Scale object [sunflare],SDistance#*300,SDistance#*300,SDistance#*300

I'm using 640x480. Unfortunatly, the FARTHER away the sun is from the center of the screen, the larger the sun flare. I need to reverse that, so the closer it is to the center of the screen, the larger the sun flare gets. How do I reverse that?

PS. Please don't send me links to another codebase or forum or anything. I've already been to most of them, and I'm having trouble understanding it.
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 3rd Aug 2004 01:40
Scale object [sunflare],SDistance#*300,SDistance#*300,SDistance#*300


..try dividing...

Scale object [sunflare],SDistance#/1.01,SDistance#/1.01,SDistance#/1.01

Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 4th Aug 2004 17:41
yup, thats basically what i was gonna say, just reverse the sum you did.
The Opposite of Multiplication is Division.

43% of Percentages are made up on the spot.
Aramil
21
Years of Service
User Offline
Joined: 27th Oct 2003
Location: Wherever my feet take me
Posted: 17th Aug 2004 12:19
Thanks! I'll try it!
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 18th Aug 2004 08:56
I've put some example DBPro Lens Flare code into the codebase.

Also, I've included some code for a Lens Flare which, with some amendment, would work on DBC in my Vector Guide. See:

http://forum.thegamecreators.com/?m=forum_view&t=34319&b=1

Cheers

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home

Login to post a reply

Server time is: 2025-05-25 02:07:33
Your offset time is: 2025-05-25 02:07:33