POV-Ray : Newsgroups : povray.documentation.inbuilt : 3.7.20.6 sunpos.inc Server Time
16 Apr 2024 02:12:39 EDT (-0400)
  3.7.20.6 sunpos.inc (Message 1 to 4 of 4)  
From: Russell Towle
Subject: 3.7.20.6 sunpos.inc
Date: 27 Nov 2007 20:50:01
Message: <web.474cc80d3c745ea32c17e1db0@news.povray.org>
Hi,

I believe there is an error in the documentation of sunpos.inc, at 3.7.20.6
sunpos.inc.

The example given reads

//begin example
#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 {...}
   }
//end example

However, if one experiments with changing the time of day, one will see that the
cylinder does not align to the sun's direction. Changing to

cylinder{
      <-2,0,0>,<2,0,0>,0.1
      rotate <0, 0, Al>
      rotate <0, Az-90, 0>
   }

fixes the problem.

It may help to use a plane at y=0 and a camera with y=up, a little above the
plane, to see the cylinder's orientation.


Post a reply to this message

From: ingo
Subject: Re: 3.7.20.6 sunpos.inc
Date: 12 Dec 2007 13:51:35
Message: <Xns9A04C9FEC6536seed7@news.povray.org>
in news:web.474cc80d3c745ea32c17e1db0@news.povray.org Russell Towle
wrote: 

> Hi,
> 
> I believe there is an error in the documentation of sunpos.inc, at
> 3.7.20.6 sunpos.inc.
> 
> [...]
> fixes the problem.


I'll have a look.

Ingo


Post a reply to this message

From: SharkD
Subject: Re: 3.7.20.6 sunpos.inc
Date: 17 Jan 2008 17:05:00
Message: <web.478fd018734cd6ed7ba03b340@news.povray.org>
"Russell Towle" <rto### [at] inreachcom> wrote:
> Hi,
>
> I believe there is an error in the documentation of sunpos.inc, at 3.7.20.6
> sunpos.inc.
>
> The example given reads
>
> //begin example
> #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 {...}
>    }
> //end example
>
> However, if one experiments with changing the time of day, one will see that the
> cylinder does not align to the sun's direction. Changing to
>
> cylinder{
>       <-2,0,0>,<2,0,0>,0.1
>       rotate <0, 0, Al>
>       rotate <0, Az-90, 0>
>    }
>
> fixes the problem.
>
> It may help to use a plane at y=0 and a camera with y=up, a little above the
> plane, to see the cylinder's orientation.

I believe (untested) that changing it to this will also work:

cylinder{
      <0,0,-2>,<0,0,2>,0.1
      rotate <Al, Az-90, 0>
   }


Post a reply to this message

From: SharkD
Subject: Re: 3.7.20.6 sunpos.inc
Date: 17 Jan 2008 17:15:00
Message: <web.478fd28c734cd6ed7ba03b340@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> I believe (untested) that changing it to this will also work:
>
> cylinder{
>       <0,0,-2>,<0,0,2>,0.1
>       rotate <Al, Az-90, 0>
>    }

Woops! I forgot to adjust the y rotation angle.

Try (still untested):

cylinder{
      <0,0,-2>,<0,0,2>,0.1
      rotate <Al, Az-180, 0>
   }

Further simplification would lead to:

 cylinder{
      <0,0,2>,<0,0,-2>,0.1
      rotate <Al, Az, 0>
   }

I believe the latter is best.


Post a reply to this message

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