POV-Ray : Newsgroups : povray.binaries.images : Bathtub - take 2 : Re: Bathtub - take 2 Server Time
1 Aug 2024 14:31:37 EDT (-0400)
  Re: Bathtub - take 2  
From: Trevor G Quayle
Date: 20 Dec 2008 11:30:00
Message: <web.494d1d1f6655db18c67b294d0@news.povray.org>
"alphaQuad" <alp### [at] earthlinknet> wrote:
>
> I am scaling the tile to get an approx 0.4 to 1 tile size (eyeballed), but that
> scales the grout also. It's boggling.
>
> Tile scaling needs ... ? doh!
>
> #declare tileplaid =
> texture {
>     pigment { uv_mapping
>       gradient x
>       pigment_map{
>         [1/7 rgb 1][1/7 gradient y
>           colour_map{
>             [1/7 rgb 1]
>             [1/7 rgb <.6,.6,1> ]
>           }
>         ]
>       }
>       scale <1/160,1/20,1>*.7
>     }
>     finish { basic_finish }
> }

The 1/7 value is the grout width value. The tile is 6/7 units and the grout is
1/7 units.

Use declare and math to adust tile/grout sizes:

#declare TilSiz= <xdim,ydim,0>;  //tile offsetting (tile size plus grout line)
#declare GrtSiz= gwid; //grout width

texture {
    pigment { uv_mapping
      gradient x
      pigment_map{
        [GrtSiz/(TilSiz.x+GrtSiz) rgb 1]
        [GrtSiz/(TilSiz.x+GrtSiz) gradient y
          colour_map{
            [GrtSiz/(TilSiz.y+GrtSiz) rgb 1]
            [GrtSiz/(TilSiz.y+GrtSiz) rgb <.6,.6,1> ]
          }
        ]
      }
      scale TilSiz
    }
    finish { basic_finish }
}

This way you can make the tiles bigger (change TilSiz) without changing the
grout size, or vice versa.

-tgq


Post a reply to this message

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