POV-Ray : Newsgroups : povray.general : sunpos.inc error : Re: sunpos.inc error Server Time
31 Jul 2024 04:16:08 EDT (-0400)
  Re: sunpos.inc error  
From: Leef me
Date: 15 Nov 2007 20:25:00
Message: <web.473cf0144b194eb42a7b15450@news.povray.org>
"Russell Towle" <rto### [at] inreachcom> wrote:
> I have used three different sun position methods in POV, and was pleased to find
> that "sunpos.inc" was bundled with recent releases of POV. However, until today
> I could never get it working properly.
>
> Part of my problem arose from an error in the official documentation of this
> macro, at
>
> http://www.povray.org/documentation/view/3.6.1/498/
>
> Here, a cylinder is (supposedly) aligned with the sun-vector, at noon (actually,
> two minutes past noon) on June 21, 2000, Greenwich, England. The error occurs
> because the cylinder
> is improperly rotated. The documentation gives
>
> cylinder{
>       <-2,0,0>,<2,0,0>,0.1
>       rotate <0, Az-90, Al>  //align cylinder with sun
>       texture {...}
>    }
>
> but for the cylinder to align properly, one must use, instead,
>
> cylinder{
>       <-2,0,0>,<2,0,0>,0.1
>       rotate <0, 0, Al>
>       rotate <0, Az-90, 0>
>    }
>
> Thus, the problem seems to be the old non-commutative rotations in three
> dimensions.
>
> It would be nice to fix the documentation.
>
> Cheers,
>
> Russell



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.

Leef_me

//-----------
//start here


#version 3.6;

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

global_settings {
  assumed_gamma 1.0
}

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

   light_source {
      //Greenwich, noon on the longest day of 2000
      SunPos(2007, 10, 18, 12, 2, -8, 32.71, -117.15)
      rgb 1
   }

camera {

  location  <-3+.5,0,0>
  look_at   <0.0, 0.0,  0.0>
     rotate <0, 0, Al>
      rotate <0, Az-90, 0>
}

   cylinder{
      <-2,0,0>,<2,0,0>,0.1
      rotate <0, Az-90, Al>  //align cylinder with sun
    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 }
}

light_source {
  <500,500,-500>       // light's position
  color rgb <1, 1, 1>  // light's color
}

light_source {
  <-500,500,-500>       // light's position
  color rgb <1, 1, 1>  // light's color
}

#if(1)
sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

#end


Post a reply to this message

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