POV-Ray : Newsgroups : povray.binaries.images : POVSolar/POVEarth: still problem with adjusting the day/night gradient Server Time
1 Nov 2024 20:22:39 EDT (-0400)
  POVSolar/POVEarth: still problem with adjusting the day/night gradient (Message 1 to 8 of 8)  
From: Jörg 'Yadgar' Bleimann
Subject: POVSolar/POVEarth: still problem with adjusting the day/night gradient
Date: 18 May 2012 19:10:02
Message: <4fb6d6ca@news.povray.org>
Hi(gh)!

Meanwhile, I almost got the boundary between day and night Earth texture 
right (by rotating the gradient of the texture_map using vrotate) - but 
still a portion of the night texture shows up on the opposite side of 
the night hemisphere (see second attached image below).

Here is my code for the time being:

#declare sc=1; // scaling factor, should be 13347, i. e. 1 POV unit 
equals 13,347 kilometres

#declare T_Earth_Night =
texture
{
   pigment
   {
     image_map
     {
       png "solarsys/ev5826_land_ocean_ice_lights_8192.png"
       map_type 1
       interpolate 2
     }
   }
   finish
   {
     ambient 0.5
     diffuse 0
   }
}

#declare T_Earth_Day =
texture
{
   pigment
   {
     image_map
     {
       png "solarsys/ev11612_land_ocean_ice_8192_POV.png"
       map_type 1
       interpolate 2
     }
   }
   finish { F_Standard_Planetary_Surface }
}

#macro SetAxis(dec, ras) // declination, right ascension (in degrees!) 
of planet's celestial north pole relative to Earth's celestial north pole
   rotate <bodies[3][4]-(90-dec), 0, 0>
   rotate <0, 90-ras, 0>
#end


union
{
   sphere // Earth, surface
   {
     0, 1
     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>
     }
     scale <bodies[3][1], bodies[3][3], bodies[3][2]>/sc
   }

   sphere // Earth, clouds
   {
     0, 1
     texture
     {
       pigment
       {
	image_map
	{
	  png "solarsys/cloud_combined_8192a_alpha.png"
	  map_type 1
	  interpolate 2
	}
       }
       finish { F_Standard_Planetary_Surface }
     }
     scale <bodies[3][1]+5, bodies[3][3]+4.983270985, bodies[3][2]+5>/sc
   }
   rotate -y*clock
   SetAxis(bodies[3][10], bodies[3][11]) // 90, 90
   translate Pos_Earth/sc
}

// end of code

Earth's position on its orbit (for the time being I use circular orbits) 



How do I get rid of the repetition of the gradient pattern?

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2012-05-19 earth, take 78 - view from 45,000 kms.png' (124 KB) Download '2012-05-19 earth, take 80 - view from 45,000 kms.png- view from 45,000 kms.png' (173 KB)

Preview of image '2012-05-19 earth, take 78 - view from 45,000 kms.png'
2012-05-19 earth, take 78 - view from 45,000 kms.png

Preview of image '2012-05-19 earth, take 80 - view from 45,000 kms.png- view from 45,000 kms.png'
2012-05-19 earth, take 80 - view from 45,000 kms.png- view from 45,000 kms.png


 

From: Tek
Subject: Re: POVSolar/POVEarth: still problem with adjusting the day/night gradient
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

From: Jörg 'Yadgar' Bleimann
Subject: Re: POVSolar/POVEarth: still problem with adjusting the day/night gradient
Date: 22 May 2012 10:27:38
Message: <4fbba25a@news.povray.org>
Hi(gh)!

On 21.05.2012 11:37, Tek wrote:
> The problem is here:
> 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]
>      }
> }

It did not work as expected - the repeated portion of the night side on 
the daylight hemisphere disappeared, but, on the other hand, the 
texture_map is no longer tilted according to Earth's axial tilt! See 
below what I've got instead...

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2012-05-22 earth, take 82 - view from 45,000 kms.png- view from 45,000 kms.png' (119 KB)

Preview of image '2012-05-22 earth, take 82 - view from 45,000 kms.png- view from 45,000 kms.png'
2012-05-22 earth, take 82 - view from 45,000 kms.png- view from 45,000 kms.png


 

From: Jörg 'Yadgar' Bleimann
Subject: Re: POVSolar/POVEarth: still problem with adjusting the day/nightgradient
Date: 22 May 2012 10:50:58
Message: <4fbba7d2@news.povray.org>
...and if I leave out the transformations inside the texture_map 
brackets, it gets even worse (see attached images)!


Post a reply to this message


Attachments:
Download '2012-05-22 earth, take 83 - view from 45,000 kms.png- view from 45,000 kms.png' (118 KB) Download '2012-05-22 earth, take 84 - view from 45,000 kms.png- view from 45,000 kms.png' (167 KB)

Preview of image '2012-05-22 earth, take 83 - view from 45,000 kms.png- view from 45,000 kms.png'
2012-05-22 earth, take 83 - view from 45,000 kms.png- view from 45,000 kms.png

Preview of image '2012-05-22 earth, take 84 - view from 45,000 kms.png- view from 45,000 kms.png'
2012-05-22 earth, take 84 - view from 45,000 kms.png- view from 45,000 kms.png


 

From: Tek
Subject: Re: POVSolar/POVEarth: still problem with adjusting the day/nightgradient
Date: 22 May 2012 12:05:01
Message: <web.4fbbb90e81bf2561a7bdb6910@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> ...and if I leave out the transformations inside the texture_map
> brackets, it gets even worse (see attached images)!

Can you show me the code for that?

There's probably still a transform that needn't be there or something.


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: POVSolar/POVEarth: still problem with adjusting the day/nightgradient
Date: 22 May 2012 12:26:29
Message: <4fbbbe35@news.povray.org>
On 22.05.2012 18:04, Tek wrote:
> Can you show me the code for that?
>
> There's probably still a transform that needn't be there or something.
>
O.k., here it is!


Post a reply to this message


Attachments:
Download 'us-ascii' (99 KB)

From: Tek
Subject: Re: POVSolar/POVEarth: still problem with adjusting the day/nightgradient
Date: 23 May 2012 05:25:01
Message: <web.4fbcac4c81bf2561a7bdb6910@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> On 22.05.2012 18:04, Tek wrote:
> > Can you show me the code for that?
> >
> > There's probably still a transform that needn't be there or something.
> >
> O.k., here it is!

The gradient isn't wrapped in pigment_pattern{}, so the rotation and scale
that's applied to the gradient is also applied to the textures in the
texture_map.

If you just copy the code from my earlier post it should work.


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: POVSolar/POVEarth: still problem with adjusting the day/nightgradient
Date: 23 May 2012 09:19:43
Message: <4fbce3ef@news.povray.org>
On 23.05.2012 11:22, Tek wrote:

> The gradient isn't wrapped in pigment_pattern{}, so the rotation and scale
> that's applied to the gradient is also applied to the textures in the
> texture_map.
>
> If you just copy the code from my earlier post it should work.
>

Not just copying, but also inserting the transformations you suggested 
in your posting of May 21... oh, and I also found out that the rotation 
around the y axis has to be applied *before* the compensation for the 
axial tilt to make the day/night boundary following the illumination 
correctly!

Here is my current code and some scenes I rendered:

union
{
   sphere // Earth, surface
   {
     0, 1
     texture
     {
       pigment_pattern
       {
         gradient z
         // transform gradient without affecting patterns in the texture_map
         scale 2 translate -z // offset to middle of gradient
	rotate <0, orb_ang, 0>
         rotate <-bodies[3][4], 0, 0> // x rotation is applied before y
       }
       texture_map
       {
         [0.45 T_Earth_Day]
         [0.48 T_Earth_Night]
       }
     }
     scale <bodies[3][1], bodies[3][3], bodies[3][2]>/sc
   }

   sphere // Earth, clouds
   {
     0, 1
     texture
     {
       pigment
       {
	image_map
	{
	  png "solarsys/cloud_combined_8192a_alpha.png"
	  map_type 1
	  interpolate 2
	}
       }
       finish { F_Standard_Planetary_Surface }
     }
     scale <bodies[3][1]+5, bodies[3][3]+4.983270985, bodies[3][2]+5>/sc
   }
   rotate -y*clock
   SetAxis(bodies[3][10], bodies[3][11])
   translate Pos_Earth/sc
}

// end of code

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2012-05-23 earth, take 86 - morning earth from 45,000 kms.png' (123 KB) Download '2012-05-23 earth, take 92 - evening earth from 45,000 kms.png' (125 KB) Download '2012-05-23 earth, take 111 - moscow from 4,000 kms, evening view.png' (570 KB) Download '2012-05-23 earth, take 128 - north pole from 20,000 kms, daylight view.png' (410 KB)

Preview of image '2012-05-23 earth, take 86 - morning earth from 45,000 kms.png'
2012-05-23 earth, take 86 - morning earth from 45,000 kms.png

Preview of image '2012-05-23 earth, take 92 - evening earth from 45,000 kms.png'
2012-05-23 earth, take 92 - evening earth from 45,000 kms.png

Preview of image '2012-05-23 earth, take 111 - moscow from 4,000 kms, evening view.png'
2012-05-23 earth, take 111 - moscow from 4,000 kms, evening view.png

Preview of image '2012-05-23 earth, take 128 - north pole from 20,000 kms, daylight view.png'
2012-05-23 earth, take 128 - north pole from 20,000 kms, daylight view.png


 

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