POV-Ray : Newsgroups : povray.binaries.images : Bathtub - take 2 : Re: Bathtub - take 2 Server Time
1 Aug 2024 12:24:47 EDT (-0400)
  Re: Bathtub - take 2  
From: alphaQuad
Date: 21 Dec 2008 17:25:01
Message: <web.494ec12c6655db18f798649f0@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{
>         [  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.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


Attachments:
Download 'boxmapping.png' (602 KB)

Preview of image 'boxmapping.png'
boxmapping.png


 

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