POV-Ray : Newsgroups : povray.text.scene-files : eval_pattern with math function Server Time
1 Nov 2024 13:21:42 EDT (-0400)
  eval_pattern with math function (Message 1 to 2 of 2)  
From: Christoph Hormann
Subject: eval_pattern with math function
Date: 11 Jun 2000 05:20:32
Message: <394359E0.664F4FC8@gmx.de>
This is the code for the Image I posted to p.b.i., it uses right hand
coordinate system. For the sky, Chris Colefax's galaxy-include is
required.

The water is just some old texture I found, so ignore it.  


Christoph


//------ Begin POV-Code ---------

#version unofficial MegaPov 0.5;
  
  
#declare galaxy_bgstars = 1;
#declare galaxy_bgnebula = false;
#declare galaxy_nebula_sphere = false;
#include "GALAXY.BG"
  
  
fog {
    fog_type 2
    fog_alt 0.4 
    fog_offset 0.4     
    color rgbt <0, 0, 0, 0> 
    distance 50
    up z
}   
  
  
camera {
    location  <-1.2, -1.1, 0.38>
    direction < 0.0,  0.0, 1.0>    // right-hand-system  z|  /y
    sky       < 0.0,  0.0, 1.0>    // with X=right;       | /
    up        < 0.0,  0.0, 1.0>    // Y=forward; Z=up     |/____x
    right     <-2.0,  0.0, 0.0>
    look_at   < 0.0,  0.0, 0.38>
    angle     37.0
}


light_source { <0.0, -15.0, 1.0> color rgb <1, 1, 1>}    
         


#declare Fkx=function { (cos(atan2(x,y)*10)) / (((x*x + y*y))*10)  }

#declare T_Math01=
   pigment {
      function { Fkx }
      color_map
      {
            [0.05 color rgb <1, 0, 0> ]
            [0.08 color rgb <0, 1, 1> ]
            [0.10 color rgb <0, 1, 1> ]
            [1.00 color rgb <0, 0, 1> ]
      }
      scale 0.3
      translate <0.5, 0.5, 0>
   }

#declare T_Math02=
   pigment {
      function { Fkx }
      color_map
      {
            [0.00 color rgb <0, 0, 0> ]
            [1.00 color rgb <1, 1, 1> ]
      }
      scale 0.3
      translate <0.5, 0.5, 0>  
   }


#declare Obj_01 = union {
   cylinder
   {
      0*z,  0.04*z,  0.007
   }
   sphere
   {
      <0, 0, 0.04>
      0.007
   }
   sphere
   {
      <0, 0, 0.0>
      0.007
   }
}


#declare nbr=100;

#declare X=0;

#while (X<nbr)
   #declare Y=0;
   #while (Y<nbr)
      #declare Col = eval_pigment(pigment {T_Math01}, <X/nbr, Y/nbr,
0>);
      #declare Col2 = eval_pigment(pigment {T_Math02}, <X/nbr, Y/nbr,
0>);

      #if ((((X/nbr-0.5)*2)^2+((Y/nbr-0.5)*2)^2)<1.0)
      object {
         Obj_01
         texture {
            pigment {color Col}
            
            finish {
               ambient 0.15
               brilliance 5
               diffuse 0.6
               metallic
               specular 0.80
               roughness 1/100
               reflection 0.65
            }
         }

         translate <-0.5+X/nbr, -0.5+Y/nbr,
0.5-(Col2.red+Col2.green+Col2.blue)/12>
      }
      #end

      #declare Y=Y+1;
   #end
   #declare X=X+1;
#end


#declare Water7 = texture {
   pigment {
     color rgb<0.365, 0.386, 0.632>
   }
   normal {
     ripples 0.24
     frequency 1.75
     turbulence 1.0
     scale     <0.0006, 0.0006, 0.001>
   }
   finish {
     diffuse 0.66
     ambient 0.09
     phong 0.38
     phong_size 34
     reflection 0.63
     specular 0.39
     roughness 0.022
   }
}

disc
{
  <0, 0, 0.26> 
  z, 300.0
  texture {Water7 scale <15, 15, 2>}
}


//------ End POV-Code ---------

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Moon47
Subject: Re: eval_pattern with math function
Date: 23 Jun 2000 11:18:03
Message: <39523124.54244269@earthlink.net>
Thank you... It has been a while but i have been busy... Thanks again
for posting... +)

Christoph Hormann wrote:

> This is the code for the Image I posted to p.b.i., it uses right hand
> coordinate system. For the sky, Chris Colefax's galaxy-include is
> required.
>
> The water is just some old texture I found, so ignore it.
>
> Christoph
>
> //------ Begin POV-Code ---------
>
> #version unofficial MegaPov 0.5;
>

> //------ End POV-Code ---------
>
> --
> Christoph Hormann <chr### [at] gmxde>
> Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

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