YEGGOR
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 1150 |
|
|
| 03 Sep 2013 03:39 AM |
I'm trying to make a script that checks if there's nothing between the camera and the sun, in order to make glare.
Thanks |
|
|
| Report Abuse |
|
|
YEGGOR
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 1150 |
|
|
| 03 Sep 2013 04:15 AM |
| y does no one ever reply to me .-. |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2013 04:45 AM |
Look in Free Models: Lens Flare. And learn from that.
Soundcrusher The Wise Has Spoken. |
|
|
| Report Abuse |
|
|
YEGGOR
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 1150 |
|
|
| 03 Sep 2013 08:04 PM |
| Please help that isn't the answer I need. I just need to know an algorithm to know where the sun is. |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2013 08:05 PM |
Maybe this will help?
http://wiki.roblox.com/index.php/Algorithms |
|
|
| Report Abuse |
|
|
YEGGOR
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 1150 |
|
| |
|
| |
|
YEGGOR
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 1150 |
|
|
| 03 Sep 2013 08:10 PM |
| I just need a math equation that can tell me a Vector3 value of where the sun is currently. |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2013 08:11 PM |
| I don't think the rendered sun actually has a position defined by a Vector3. |
|
|
| Report Abuse |
|
|
YEGGOR
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 1150 |
|
|
| 03 Sep 2013 08:13 PM |
Please just tell me something helpful. There are games that use raycasting to make sure they're not glaring the player while they're inside a room.
I just need to know how they do that. |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 03 Sep 2013 08:17 PM |
Probably involves Latitude in game.Lighting and TimeOfDay converted into minutes.
There are a ton of calculations... You might want to work that out first. Its too much work for a person on a forum to work out...
Use math.asin, math.atan to figure out vectors... good luck |
|
|
| Report Abuse |
|
|
YEGGOR
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 1150 |
|
|
| 03 Sep 2013 08:28 PM |
do you think if I just times the cameras lookVector by 999 then raycast it, it will work?
it will pretty much simulate the same thing, because the camera has to be looking at the sun to actually make the glare.
|
|
|
| Report Abuse |
|
|
seth101
|
  |
| Joined: 06 Nov 2007 |
| Total Posts: 554 |
|
|
| 03 Sep 2013 08:33 PM |
Here you go man. I found it, unlike how these lamebrains couldn't even give you a straight answer.
GetSunDirection "Returns a lookVector value of a CFrame directed at the current position of the sun." |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 03 Sep 2013 08:37 PM |
This is an approximate algorithm. Roblox, for some reason, doesn't like my script, and says it breaks the rules. Here you are: http://repl.it/KYV |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 03 Sep 2013 08:37 PM |
@seth FNJKDNGSDJFNGJDSLBKS THESE NEW METHODS ARE IRRITATING. |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2013 08:38 PM |
| Yes, use GetSunDirection as Seth said. It's been around for quite a while now |
|
|
| Report Abuse |
|
|
YEGGOR
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 1150 |
|
|
| 03 Sep 2013 09:43 PM |
Thanks guys, I got it after a while. It works brilliantly now.
And I'm really happy to see that crazyman32 posted on my thread :D |
|
|
| Report Abuse |
|
|