POV-Ray : Newsgroups : povray.binaries.images : Gradient Twilight : Re: Gradient Twilight Server Time
4 Nov 2024 13:03:47 EST (-0500)
  Re: Gradient Twilight  
From: IMBJR
Date: 15 Sep 2000 18:06:24
Message: <39c29d60@news.povray.org>
You will notice references to Connie in this, that's because she was the
original image I tried with this code. You will need a 400x239 PNG image
called asky.png for this code to work unamended. And yes, you will Mega-POV
to do this.

PS. The clock stuff is in there, again, because of the original Connie
animation I did.

---- Code begins

#version unofficial MegaPov 0.5;

global_settings {
 assumed_gamma 2.2
 //post_process {normal}
}

#declare ss = seed(666);

#include "colors.inc"

camera {
   location  <0, 5,-500> //<0, 0,-275>

   up <0,1,0>
   right <1,0,0>
   //normal { crackle form <0.5,-0.25,0.5>  scale 0.3  }
   look_at   <0, 200, 0>
}

light_source {<0, 100, -1000> color White}

background {Black}

//#declare xp = 160;
//#declare yp = 245;

#declare xp = 400;
#declare yp = 239;

#declare trans_color = color Green;

#declare connie_pigment =
 pigment {
  image_map {
   png
   //"connie.png" once //interpolate 2
   "asky.png" once //interpolate 2
   // filter 77, 1
  }
  scale <xp, yp, 1>
  translate <-xp/2, -yp/2, 0>
 }

#declare connie =
texture {
 pigment {connie_pigment}
 finish {
  ambient 1
 }
}

polygon {
 5,
 <-xp/2, -yp/2>,
 <-xp/2, yp/2>,
 <xp/2, yp/2>,
 <xp/2, -yp/2>,
 <-xp/2, -yp/2>

 texture {
  connie
 }
 no_image
 no_shadow
}

//////////////////

#declare clockt = 1;

#declare w = 1+floor(75*clockt);
#declare h = 1+floor(75*clockt);
#declare colors= array[w][h]
#declare xx = 0;

#declare gradp = pigment {
 gradient x
 pigment_map {
 #while (xx < w)
  #declare yy = 0;
  [xx/(w-1) gradient y
  pigment_map {
  #while (yy < h)
   #declare pcol = eval_pigment(connie_pigment,
    <-xp/2 + (xx/(w-1))*xp + rand(ss)*5,
     -yp/2 + (yy/(h-1))*yp + rand(ss)*5,
     0>);
/*
   #if ((pcol.green = trans_color.green) &
        (pcol.blue  = trans_color.blue) &
        (pcol.red   = trans_color.red)
       )
    #declare pcol = rgbt <1,1,1,1>;
   #end
*/
   [yy/(h-1) color pcol]
   #declare colors[xx][yy] = pcol;
   #declare yy = yy + 1;
  #end
  }
  ]
  #declare xx = xx + 1;
 #end
 }
}

///////////////////////////////////////////

/*
polygon {
 5,
 <-xp/2, -yp/2>,
 <-xp/2, yp/2>,
 <xp/2, yp/2>,
 <xp/2, -yp/2>,
 <-xp/2, -yp/2>

 texture {
  pigment{gradp
   scale <xp,yp,1>
   translate <-xp/2,-yp/2,0>
  }
  finish {
   ambient 1
  }
 }
}
*/

sky_sphere {
  pigment{gradp
   //scale <xp,yp,1>
   turbulence 0.1
   translate <0,-yp+15,0>
   rotate <0,40,0>
  }
}

plane {
 y, 0
 texture {
  pigment {color Grey}
 }
}

-- Code ends


H. E. Day wrote in message <01c01f5d$f7baadc0$037889d0@daysix>...
>Please, sir, post the code for this!
>
>
>H.E. Day
><><


Post a reply to this message

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