POV-Ray : Documentation : 2.7.20.6 sunpos.inc
  POV-Ray 3.6 Documentation Online View  
2.7.20.5 stage1.inc   2.7.20.7 font files (*.ttf)

2.7.20.6 sunpos.inc

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.
Parameters:

  • 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

Use :

   #include "sunpos.inc"

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

   cylinder{
      <-2,0,0>,<2,0,0>,0.1
      rotate <0, Az-90, Al>  //align cylinder with sun
      texture {...}
   }
2.7.20.5 stage1.inc   2.7.20.7 font files (*.ttf)


Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.