Sun that Expands?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Sun that Expands?

Post by devsh »

Hi everyone,

how do I do a sun that gets bigger when its more toward center of the screen??

I tried everything with shaders but i simply cannot do it..
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Scale it based on how close it is to the centre of the screen? :?

I'm not sure why you'd want to do it though...

Wrong forum, incidentally ;)
Image Image Image
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

yeah but i dont know how to calculate how close it is to center of the screen!
cr33
Posts: 22
Joined: Fri Mar 27, 2009 3:37 pm

Post by cr33 »

i don't know how to get node position on screen, but you could use getRayFromScreenCoordinates() or camera->getTarget(), then compare make vertex that is in same distance as sun and then compare it's distance to it. i mean like this:

Code: Select all

center
 ------   sun
|     /
|   /
| /
|/
camera
i guess it's not the most efficient way to do this, but it's just idea :P
also, maybe this could help:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=31365
Jookia
Posts: 170
Joined: Wed Nov 19, 2008 1:11 am

Post by Jookia »

If you're looking at the direction of the sun, compare the x position. To make it bigger use setScale.
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Post by devsh »

dude's thank you SOOO MUCH

it's the line

I can compare the camera target normal against the sun position (also turned into normal) and then do same as in lighting!!!
Post Reply