generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How to find where the sun is?

Previous Thread :: Next Thread 
YEGGOR is not online. 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 is not online. YEGGOR
Joined: 02 Apr 2013
Total Posts: 1150
03 Sep 2013 04:15 AM
y does no one ever reply to me .-.
Report Abuse
Soundcrusher is not online. Soundcrusher
Joined: 25 Aug 2011
Total Posts: 559
03 Sep 2013 04:45 AM
Look in Free Models: Lens Flare. And learn from that.

Soundcrusher The Wise Has Spoken.
Report Abuse
YEGGOR is not online. 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
madness725 is not online. madness725
Joined: 19 Apr 2011
Total Posts: 2058
03 Sep 2013 08:05 PM
Maybe this will help?

http://wiki.roblox.com/index.php/Algorithms
Report Abuse
YEGGOR is not online. YEGGOR
Joined: 02 Apr 2013
Total Posts: 1150
03 Sep 2013 08:09 PM
no
Report Abuse
madness725 is not online. madness725
Joined: 19 Apr 2011
Total Posts: 2058
03 Sep 2013 08:09 PM
What do you need then?
Report Abuse
YEGGOR is not online. 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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
03 Sep 2013 08:11 PM
I don't think the rendered sun actually has a position defined by a Vector3.
Report Abuse
YEGGOR is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
03 Sep 2013 08:37 PM
@seth
FNJKDNGSDJFNGJDSLBKS
THESE NEW METHODS ARE IRRITATING.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
03 Sep 2013 08:38 PM
Yes, use GetSunDirection as Seth said. It's been around for quite a while now
Report Abuse
YEGGOR is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image