POV-Ray : Newsgroups : povray.binaries.images : Bathtub - take 2 : Re: Bathtub - take 2 Server Time
1 Aug 2024 12:20:26 EDT (-0400)
  Re: Bathtub - take 2  
From: Trevor G Quayle
Date: 20 Dec 2008 22:05:02
Message: <web.494db23a6655db18c67b294d0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
Slight problem with some grout scaling being off, try this instead:

//START
#declare BSiz=<20,6,10>;  //Size of box
#declare TilSiz=<2,1>;    //Size of tile (x,y)
#declare Grt=0.5;         //Width of grout

#declare TilCol=rgb 0;  //Tile colour
#declare GrtCol=rgb 1;  // Grout colour

#declare DimU=Grt/TilSiz.u; //Grout scaling x
#declare DimV=Grt/TilSiz.v; //Grout scaling y

#declare PX=pigment{  //Tile pattern x plane
      gradient x
      pigment_map{
        [  DimZ/2 GrtCol]
        [  DimZ/2 gradient y colour_map{[DimV/2 GrtCol][DimV/2 TilCol][1-DimV/2
TilCol][1-DimV/2 GrtCol]}]
        [1-DimZ/2 gradient y colour_map{[DimV/2 GrtCol][DimV/2 TilCol][1-DimV/2
TilCol][1-DimV/2 GrtCol]}]
        [1-DimZ/2 GrtCol]
      }
      scale <TilSiz.u/BSiz.z/4,TilSiz.v/BSiz.y/3>
}

#declare PY=pigment{  //Tile pattern y plane
      gradient x
      pigment_map{
        [  DimU/2 GrtCol]
        [  DimU/2 gradient y colour_map{[DimV/2 GrtCol][DimV/2 TilCol][1-DimV/2
TilCol][1-DimV/2 GrtCol]}]
        [1-DimU/2 gradient y colour_map{[DimV/2 GrtCol][DimV/2 TilCol][1-DimV/2
TilCol][1-DimV/2 GrtCol]}]
        [1-DimU/2 GrtCol]
      }
      scale <TilSiz.u/BSiz.x/4,TilSiz.v/BSiz.z/3>
}

#declare PZ=pigment{  //Tile pattern y plane
      gradient x
      pigment_map{
        [  DimU/2 GrtCol]
        [  DimU/2 gradient y colour_map{[DimV/2 GrtCol][DimV/2 TilCol][1-DimV/2
TilCol][1-DimV/2 GrtCol]}]
        [1-DimU/2 gradient y colour_map{[DimV/2 GrtCol][DimV/2 TilCol][1-DimV/2
TilCol][1-DimV/2 GrtCol]}]
        [1-DimU/2 GrtCol]
      }
      scale <TilSiz.u/BSiz.x/4,TilSiz.v/BSiz.y/3>
}

#declare BoxUV= //Tile pattern for uv box
  pigment{
    uv_mapping
    gradient x
    pigment_map{
      [0/4 PX]  //Xmin
      [1/4 PX]  //Xmin
      [1/4 gradient y pigment_map{
                                  [0/3 PY]  //Ymin
                                  [1/3 PY]  //Ymin
                                  [1/3 PZ]  //Zmax
                                  [2/3 PZ]  //Zmax
                                  [2/3 PY]  //Ymax
                                  [3/3 PY]  //Ymax
                                  }]
      [2/4 gradient y pigment_map{
                                  [0/3 PY]  //Ymin
                                  [1/3 PY]  //Ymin
                                  [1/3 PZ]  //Zmax
                                  [2/3 PZ]  //Zmax
                                  [2/3 PY]  //Ymax
                                  [3/3 PY]  //Ymax
                                  }]
      [2/4 PX]  //Xmax
      [3/4 PX]  //Xmax
      [3/4 PZ]  //Zmin
      [4/4 PZ]  //Zmin
    }
  }
//END


Post a reply to this message

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