From POV-Wiki
Revision as of 19:08, 15 March 2012 by Jholsenback (talk | contribs) (1 revision: Reference Migration Initial Load)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This file only contains the sunpos() macro

sunpos(Year, Month, Day, Hour, Minute, Lstm, LAT, LONG): The macro returns the position of the sun, for a given date, time, and location on earth. The suns position is also globally declared as the vector SolarPosition. Two other declared vectors are the Az (Azimuth) and Al (Altitude), these can be useful for aligning an object (media container) with the sunlight. Assumption: in the scene north is in the +Z direction, south is -Z.


  • Year= The year in four digits.
  • Month= The month number (1-12).
  • Day= The day number (1-31).
  • Hour= The hour of day in 24 hour format (0-23).
  • Minute= The minutes (0-59).
  • Lstm= Meridian of your local time zone in degrees (+1 hour = +15 deg, east = positive, west = negative)
  • LAT= Lattitude in degrees.decimal, northern hemisphere = positive, southern = negative
  • LONG= Longitude in degrees.decimal, east = positive, west is negative


#include ""

light_source {
  //Greenwich, noon on the longest day of 2000
  SunPos(2000, 6, 21, 12, 2, 0, 51.4667, 0.00) 
  rgb 1

  rotate <0, Az-90, Al>  //align cylinder with sun
  texture {...}

Note: The default distance of the sun from the origin is 1e+9 units.