POV-Ray : Newsgroups : povray.binaries.images : POVSolar/POVEarth: still problem with adjusting the day/night gradient : Re: POVSolar/POVEarth: still problem with adjusting the day/night gradient Server Time
30 Jul 2024 08:15:31 EDT (-0400)
  Re: POVSolar/POVEarth: still problem with adjusting the day/night gradient  
From: Tek
Date: 21 May 2012 05:40:01
Message: <web.4fba0cd339339c11a7bdb6910@news.povray.org>
The problem is here:

>      texture
>      {
>        #declare grd=vrotate(z, -<bodies[3][4], 0, 0>);
>        gradient vrotate(grd, <0, orb_ang, 0>)
>        texture_map
>        {
>  [0.45    T_Earth_Day translate z*1 scale 0.5]
>  [0.45 T_Earth_Night translate z*1 scale 0.5]
>        }
>        scale 2
>        translate <0, 0, -1>
>      }

You've got a gradient pointing in the direction of that vrotate vector, which
you scale by 2, then translate by -1 on the *z* axis. You want to translate it
in the same direction as the gradient.

If you want to be lazy you can remove that translate and just do "phase 0.5",
which will shift the gradient in the way you want. But personally I'd do it like
this:

texture {
    pigment_pattern { // isolate transforms from the day/night maps
        gradient z
        scale 2 translate -z // offset to middle of gradient
        rotate <-bodies[3][4], orb_ang, 0> // x rotation is applied before y
    }
    texture_map {
        [0.45 T_Earth_Day]
        [0.45 T_Earth_Night]
    }
}


Post a reply to this message

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