|
| 04 Nov 2012 05:47 PM |
Please help me complete my gui. I need a way to get four seperate number values: 1.) How far right the player's camera view is from the sun 2.) How far left the player's camera view is from the sun 3.) How much higher the player's camera view is from the sun 4.) How much lower the player's camera view is from the sun
This, hypothetically could be simplified into two number values: 1.) How far right and/or left the player's camera view is from the sun 2.) How much higher and/or lower the player's camera view is from the sun
I need this to make a final awesome addition to a lense flare gui I developed with people on this forum a while ago! Please do help!
|
|
|
| Report Abuse |
|
|
|
| 04 Nov 2012 06:33 PM |
| We are scripting helpers, not scripting writers. At least attempt to make the code, and we will fix it even if it has hundreds of errors. We won't write code for you though. |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2012 09:16 PM |
| Ok! I will try to write it! |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2012 09:55 PM |
Talk to Anaminus. He's a genius when it comes to this stuff :P
In fact, I believe he has a plugin that lets you click in the sky and it will move the sun to that position. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 04 Nov 2012 11:10 PM |
o wiat it's not that hard,
geogprahial longitufeg or whateveretufcg |
|
|
| Report Abuse |
|
|
pashmi
|
  |
| Joined: 27 Jan 2010 |
| Total Posts: 7120 |
|
|
| 05 Nov 2012 01:16 AM |
| actually probably he wrote a formula which takes the skybox's position into account, and moves the sun by a degree + that formula |
|
|
| Report Abuse |
|
|
Aerideyn
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 1882 |
|
|
| 05 Nov 2012 04:28 AM |
cam = workspace.CurrentCamera
sunDirection = game.Lighting:GetSunDirection() camDirection = cam.CoordinateFrame.lookVector
sunDirectionXZPlane = Vector3.new(sunDirection.X,0,sunDirection.Z).unit
camDirectionXZPlane = Vector3.new(camDirection.X,0,camDirection.Z).unit camDirectionYPlane = Vector3.new(sunDirection.X,camDirection.Y,sunDirection.Z).unit
angleLeftRight = math.acos(camDirectionXZPlane:Dot(sunDirectionXZPlane)) angleUpDown = math.acos(camDirectionYPlane:Dot(sunDirection))
--If you want the total angle it's much simpler...
angle = math.acos(camDirection:Dot(sunDirection)) |
|
|
| Report Abuse |
|
|