POV-Ray : Newsgroups : povray.binaries.images : Bathtub - take 2 : Re: Bathtub - take 2 Server Time
1 Aug 2024 12:27:43 EDT (-0400)
  Re: Bathtub - take 2  
From: Trevor G Quayle
Date: 20 Dec 2008 22:35:01
Message: <web.494db8616655db18c67b294d0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> Next step will be to make it as a
> single pattern...

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

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


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

#declare CMapVGrt=colour_map{[DimV GrtCol][DimV TilCol][1-DimV TilCol][1-DimV
GrtCol]}

#declare BoxUV= //Tile pattern for uv box
  pigment{
    uv_mapping
    gradient x
    pigment_map{
      [1/4 gradient x
        pigment_map{
          [  DimU GrtCol]
          [  DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.y/TilSiz.v]
          [1-DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.y/TilSiz.v]
          [1-DimU GrtCol]
        }
        frequency 4*BSiz.z/TilSiz.u
      ]
      [1/4 gradient x
        pigment_map{
          [  DimU GrtCol]
          [  DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.z/TilSiz.v]
          [1-DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.z/TilSiz.v]
          [1-DimU GrtCol]
        }
        frequency 4*BSiz.x/TilSiz.u
      ]
      [2/4 gradient x
        pigment_map{
          [  DimU GrtCol]
          [  DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.z/TilSiz.v]
          [1-DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.z/TilSiz.v]
          [1-DimU GrtCol]
        }
        frequency 4*BSiz.x/TilSiz.u
      ]
      [2/4 gradient x
        pigment_map{
          [  DimU GrtCol]
          [  DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.y/TilSiz.v]
          [1-DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.y/TilSiz.v]
          [1-DimU GrtCol]
        }
        frequency 4*BSiz.z/TilSiz.u
      ]
      [3/4 gradient x
        pigment_map{
          [  DimU GrtCol]
          [  DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.y/TilSiz.v]
          [1-DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.y/TilSiz.v]
          [1-DimU GrtCol]
        }
        frequency 4*BSiz.z/TilSiz.u
      ]
      [3/4 gradient x
        pigment_map{
          [  DimU GrtCol]
          [  DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.y/TilSiz.v]
          [1-DimU gradient y colour_map{CMapVGrt} frequency 3*BSiz.y/TilSiz.v]
          [1-DimU GrtCol]
        }
        frequency 4*BSiz.x/TilSiz.u
      ]
    }
  }

box{0, BSiz pigment{BoxUV}}
//END


Post a reply to this message

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