FlightGear - /sim/time/sun-angle-rad

The sun moves in the sky during the day and night. FlightGear has a property which gives the exact angle of the sun related to the actual vertical axis on the ground. It's called /sim/time/sun-angle-rad.
It gives a value in radiants, i.e. proportionally to Pi whose value is approximately 3.14.

At noon, when the sun is up, perfectly perpendicular to the ground: sun-angle-rad = 0 rad    (*).
Then the sun goes down, untill at dawn, when the sun is at the horizon: sun-angle-rad = (Pi/2) rad.
During the night, the sun is down under the horizon and has values ranging from Pi/2 to Pi.




In conclusion, /sim/time/sun-angle-rad varies between 0 and 3.14.
I use that property values for lighting up 3d model objects in the night and turning their light off in the day. You can check an example with the Seattle Space Needle whose material animation is:
  <animation>
  <type>material</type>
  <object-name>pCylinder1_group5.0</object-name>
  <emission>
    <red>5.56</red>
    <green>0.0</green>
    <blue>0.0</blue>
    <offset>-8.72</offset>
    <factor-prop>/sim/time/sun-angle-rad</factor-prop>
  </emission>
  </animation>



(*) the sun is generally not perpendicular to the ground even at noon. You have to be at the equator to have such a position at noon, and that happens just two times per latitude position during the year.

Roberto

Hosted by www.Geocities.ws

1