POV-Ray : Newsgroups : povray.binaries.images : Sky simulation : Re: Sky simulation: what is wrong with this particular code? Server Time
30 Jul 2024 10:19:18 EDT (-0400)
  Re: Sky simulation: what is wrong with this particular code?  
From: scott
Date: 5 Jul 2013 09:38:01
Message: <51d6cc39$1@news.povray.org>
On 05/07/2013 13:35, Thomas de Groot wrote:
> Consider the following scene code:
>
> //start code
> #version 3.7;
>
> #include "colors.inc"
>
> global_settings {assumed_gamma 1.0}
>
> camera {
>    location  <0, 5, -40>
>    sky       y
>    up        y
>    direction z*1.7
>    right     x*image_width/image_height
>    angle     70
>    look_at   <0, 5, 100>
> }
>
> #include "sunpos.inc"
> #declare MySun  = SunPos(2012, 3, 5, 13, 10, 0, 31.7625, 25.0888);
> #declare EXP = 8e-5;
>
> // SkySim
> #include "SkySim.inc"
> SkySim( SolarPosition,
>       y,
>       5,
>       EXP
>     )
>
> #declare SunColor = rgb 1;
>
> light_source {
>    MySun
>    color    SunColor*(17334 * EXP)
>    //parallel
>    //point_at <0, 5, 100>
> }
>
>
> plane {y, -5 pigment {rgb 1}}
> cylinder {<0,-5,10>, <0,6,10>, 1 pigment {rgb <1,0,0>}}
>
> //end code
>
> It renders well (see image: SkySim_SolarPosition) also with parallel and
> point_at in the light_source uncommented.
>
> Now, switch SolarPosition in the SkySim macro call, by MySun. I get
> image SkySim_MySun.
>
> Now, uncomment parrale and point_at in the light_source. I get image
> SkySim_MySun parallel.
>
> So, what is wrong here? All goes well in the original test scene.

Hmmm ok, so apparently I misunderstood the POV syntax, this short piece 
of code prints X=9 whereas I assumed it would print X=10. Not sure if 
this is intended behaviour or not.

// start code

#macro A(B)
#local B = B - 1;
#end

#declare X = 10;
A(X)
#warning concat("X = ",str(X,0,0))

// end code

Will fix the macro and post and update... (it's essentially normalizing 
your sun position, which you're then using the place the light source).


Post a reply to this message

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