POV-Ray : Newsgroups : povray.general : sunpos.inc error : Re: sunpos.inc error Server Time
31 Jul 2024 04:23:14 EDT (-0400)
  Re: sunpos.inc error  
From: Russell Towle
Date: 27 Nov 2007 12:35:01
Message: <web.474c53804b194eb4ca8cf1740@news.povray.org>
"Leef_me" <nomail@nomail> wrote:

> Hi Russell,
>
> Wrong time, yes. But you get to the same angle either way ya go.
>
> Try this code, it sure seems like the red and yellow cylinders are concentric.


Nope, it's all wrong. They are concentric but for the wrong reasons. Note that
the sunpos.inc macro requires its arguments to be {year, month, day, hours,
minutes, ***central meridian of time zone***, latitude, longitude}. So, say you
live at latitude -117.15 degrees. The time zone meridian you must use will be
some multiple of fifteen degrees. Say, if you are eight hours behind Greenwich
time, then 8*15=120; and -120 degrees will be your central meridian. Hence I
change your example to

SunPos(2007, 10, 18, 12, 2, -120, 32.71, -117.15),

but this would be incorrect if you are in the Mountain zone, rather than the
Pacific
zone.

This will show the differing orientation of the cylinders:

//begin example

#version 3.6;

#include "colors.inc"
#include "sunpos.inc"

global_settings {
  assumed_gamma 1.0
}

// ----------------------------------------

   light_source {
     //a point at longitude -117.15, latitude 32.71
      SunPos(2007, 10, 18, 12, 2, -120, 32.71, -117.15)
      rgb 1
   }

camera {
location  <2,5,-1>
 look_at   0
 }

   cylinder{
      <-2,0,0>,<2,0,0>,0.1
      rotate <0, Az-90, Al>  //align cylinder with sun: wrong!!!
    pigment { color Red }
   }

   cylinder{
      <-2-.01,0,0>,<2+.01,0,0>,0.05
      <-2-.3,0,0>,<2,0,0>,0.03
     rotate <0, 0, Al>
     rotate <0, Az-90, 0>
    pigment { color Yellow }
   }


// ----------------------------------------

plane {
  y, -1
  pigment { color White }
}

//end example


Post a reply to this message

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