POV-Ray : Newsgroups : povray.binaries.images : Bathtub - take 2 Server Time
1 Aug 2024 14:27:33 EDT (-0400)
  Bathtub - take 2 (Message 41 to 50 of 65)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Trevor G Quayle
Subject: Re: Bathtub - take 2
Date: 20 Dec 2008 17:45:01
Message: <web.494d74666655db18c67b294d0@news.povray.org>
"alphaQuad" <alp### [at] earthlinknet> wrote:
>
> when you said "The 1/7 value is the grout width value." , a light sort of went
> on ... but there is y grout and and x grout.
>
> the math for the correct y-grout-[scale] due to y-scaling is ... ? puzzling
>  ".5" value which I guessed at, since it looked 2 times too big.
>
> In the real Lego world this is what worked:
>
> #declare TilSiz= <6/7,12/7,1>;  //tile offsetting (tile size plus grout line)
> #declare GrtSiz= 1/7; //grout width
> //0.142857
> echof(GrtSiz/(TilSiz.x+GrtSiz))     // 0.14286
> cr()
> echof(GrtSiz/(TilSiz.y+GrtSiz))     // 0.07143
> cr()
> #declare tileplaid =
> #if (10)
> 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*.01
>       scale <1/160,1/20,1>*.7
>     }
>     finish { basic_finish }
> }
> #else
> texture {
>     pigment { uv_mapping
>       gradient x
>       pigment_map{
>         [1/7 rgb 1]
>         [1/7 gradient y
>           colour_map{
>             [(1/7)*.5 rgb 1]
>             [(1/7)*.5 rgb <.6,.6,1> ]
>           }
>         ]
>       }
>       scale <1/160,1/20,1>*.7 // ==  0.00625 / .05 = 0.125 1/8
>     }
>     finish { basic_finish }
> } #end
>
>
> still had to scale by something else not TilSiz
> scale by TilSiz = a grout line half the pool's width and tiles with a greater
> xdim


x grout and y grout should be handled just fine the way I showed, as long as you
want it the same tickness for both.

I'm not sure how you are applying the texture, but it's likely the uv mapping
that is causing you an issue as the pattern is not getting scaled as expected
(or rather as wanted...).  The scale you are using is 1/160 x 1/20 which is an
8:1 ratio, whereas you are getting the pattern to work by misscaling by a 2:1
ratio.  You need to determine how the uv mapping is effecting the pattern and
scale both the x/y of the tiles and have a separate x&y grout scaling that is
based on the proportional scaling that the uv mapping is applying.

-tgq


Post a reply to this message

From: alphaQuad
Subject: Re: Bathtub - take 2
Date: 20 Dec 2008 18:15:00
Message: <web.494d7c296655db18b4cbed3d0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:

> I'm not sure how you are applying the texture, but it's likely the uv mapping
> that is causing you an issue as the pattern is not getting scaled as expected

texture applied like any other ...
#declare tileplaid =
texture {
    pigment { uv_mapping
      gradient x
      pigment_map{
        [1/7 rgb 1][1/7 gradient y
          colour_map{
            [(1/7)*.5 rgb 1]
            [(1/7)*.5 rgb <.6,.6,1> ]
          }
        ]
      }
      scale <1/160,1/20,1>*.7
    }
    finish { basic_finish }
}
#declare pool_box =
difference {
    box { <-8, -66.5, -8> <232, 0, 232> } // legoworld hole
    box { <0, -65, 0> <224, 1, 224> }
    texture { tileplaid }
    translate <-8,0,-8>
}
union {
object { pool_box }
object { TQ_water2 }
object { beachball scale 8.5 rotate z*45 rotate y*-55 translate <30,6.5,55> }
translate y*4
}


You have been such a fantasic source on this, didn't mean to derail your thread.
I could see someone had a clue on water.

That is the code, 2:1 and 8:1, that made the image which all speaks for itself:

I never expect perfection, but expect imperfection that is for me to... enhance.
I hesitate to say perfect.


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Bathtub - take 2
Date: 20 Dec 2008 18:50:01
Message: <web.494d83ba6655db18c67b294d0@news.povray.org>
"alphaQuad" <alp### [at] earthlinknet> wrote:
> "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
>
> > I'm not sure how you are applying the texture, but it's likely the uv mapping
> > that is causing you an issue as the pattern is not getting scaled as expected
>
> texture applied like any other ...
> #declare tileplaid =
> texture {
>     pigment { uv_mapping
>       gradient x
>       pigment_map{
>         [1/7 rgb 1][1/7 gradient y
>           colour_map{
>             [(1/7)*.5 rgb 1]
>             [(1/7)*.5 rgb <.6,.6,1> ]
>           }
>         ]
>       }
>       scale <1/160,1/20,1>*.7
>     }
>     finish { basic_finish }
> }
> #declare pool_box =
> difference {
>     box { <-8, -66.5, -8> <232, 0, 232> } // legoworld hole
>     box { <0, -65, 0> <224, 1, 224> }
>     texture { tileplaid }
>     translate <-8,0,-8>
> }
> union {
> object { pool_box }
> object { TQ_water2 }
> object { beachball scale 8.5 rotate z*45 rotate y*-55 translate <30,6.5,55> }
> translate y*4
> }
>
>
> You have been such a fantasic source on this, didn't mean to derail your thread.
> I could see someone had a clue on water.
>
> That is the code, 2:1 and 8:1, that made the image which all speaks for itself:
>
> I never expect perfection, but expect imperfection that is for me to... enhance.
> I hesitate to say perfect.


Not a problem. I always like to help.  (Unfortunatly my real work suffers when I
get preoccupied elsewhere...)

If you know the size of the pool box, then refer to uv_mapping in the docs to
see how it gets applied.  You should be able to work out the proportions and
mathematics from that.  I may do some more playing with it later when I get a
chance.

"3.5.7.1  Supported Objects"
This section shows how the texture gets sampled and applied to a box object.

-tgq


Post a reply to this message

From: Cousin Ricky
Subject: Re: Bathtub - take 2
Date: 20 Dec 2008 21:38:43
Message: <op.umhqyg0e6b35ac@your-727a0a4e7c.vipowernet.net>
> "Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote:
> > I am not entirely sure if this function is really natural to a  
> bathtube or
> > any confined water surface, up to a certain scale.

"alphaQuad" <alp### [at] earthlinknet> wrote:
> I'd love to see someone find something better than f_ridge for the Lego  
> pool.

I don't know what your criteria are for the Lego pool, but I'm sure  
someone can do better than both f_ridged_mf() and f_ridged().  Please find  
attached isocolor and shaded relief illustrations of these functions.   
They are:
   - waves-ridge1.jpg - f_ridged_mf() as Christoph used it;
   - waves-ridge2.jpg - Christoph's usage as I modified it;
   - waves-ridge3.jpg - f_ridge() as alphaQuad used it.
They don't exactly look like water waves from this angle.

These function calls appear to be the sort of tool that does its job well  
 from certain perspective--namely, water waves at typical viewing  
angles--but are hardly general solutions.

> I doubt anyone can.

Very fragile generalization.

-- 
<Insert witty .sig here>


Post a reply to this message


Attachments:
Download 'waves-ridge1.jpg' (104 KB) Download 'waves-ridge2.jpg' (122 KB) Download 'waves-ridge3.jpg' (72 KB)

Preview of image 'waves-ridge1.jpg'
waves-ridge1.jpg

Preview of image 'waves-ridge2.jpg'
waves-ridge2.jpg

Preview of image 'waves-ridge3.jpg'
waves-ridge3.jpg


 

From: Trevor G Quayle
Subject: Re: Bathtub - take 2
Date: 20 Dec 2008 21:50:00
Message: <web.494dae6c6655db18c67b294d0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "alphaQuad" <alp### [at] earthlinknet> wrote:
> > "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> >
>
> If you know the size of the pool box, then refer to uv_mapping in the docs to
> see how it gets applied.  You should be able to work out the proportions and
> mathematics from that.  I may do some more playing with it later when I get a
> chance.
>
> "3.5.7.1  Supported Objects"
> This section shows how the texture gets sampled and applied to a box object.
>
> -tgq

OK this took a little work, but should take the guesswork out of tiling the
pool.  I've added a few tricks to this as well.  The uvmapping you were using
can be adapted to a square shape pool, but if you were to change to a
rectangular shape, it would cause big problems.  This pattern will avoid this
and let you have reactangular pools with a consistent tile size and grout size.
 You'll also noticed that I offset the grouting by half its size and added a
half grout to the opposite side so the each full tile rectangle is bounded on
all sides by a half width of grout.  This makes it work nice at the edges so
that the tile is not butting the edges, but rather grout.  Each individual
x/y/z plane pattern is sized independently and then added to the areas
corresponding to the uv mapping of the box.  Next step will be to make it as a
single pattern...

-tgq


//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;  // Grout colour

#declare DimX=Grt/TilSiz.u; //Grout scaling x
#declare DimY=Grt/TilSiz.v; //Grout scaling y
#declare DimZ=Grt/TilSiz.v; //Grout scaling z

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

#declare PZ=pigment{  //Tile pattern y plane
      gradient x
      pigment_map{
        [  DimX/2 GrtCol]
        [  DimX/2 gradient y colour_map{[DimY/2 GrtCol][DimY/2 TilCol][1-DimY/2
TilCol][1-DimY/2 GrtCol]}]
        [1-DimX/2 gradient y colour_map{[DimY/2 GrtCol][DimY/2 TilCol][1-DimY/2
TilCol][1-DimY/2 GrtCol]}]
        [1-DimX/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{
      [1/4 PX]  //Xmin
      [1/4 gradient y pigment_map{
                                  [1/3 PY]  //Ymin
                                  [1/3 PZ]  //Zmax
                                  [2/3 PZ]  //Zmax
                                  [2/3 PY]  //Ymax
                                  }]
      [2/4 gradient y pigment_map{
                                  [1/3 PY]  //Ymin
                                  [1/3 PZ]  //Zmax
                                  [2/3 PZ]  //Zmax
                                  [2/3 PY]  //Ymax
                                  }]
      [2/4 PX]  //Xmax
      [3/4 PX]  //Xmax
      [3/4 PZ]  //Zmin
    }
  }

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


Post a reply to this message

From: alphaQuad
Subject: Re: Bathtub - take 2
Date: 20 Dec 2008 22:05:01
Message: <web.494db1786655db189963dd650@news.povray.org>
"Cousin Ricky" <ric### [at] yahoocom> wrote:
>
> > I doubt anyone can.
>
> Very fragile generalization.
>
you got me, I'm smarter than that, I was fishing and caught a bite

whoa both my fav water ppl in one day.

this is Cousin Ricky absorption, as they all have been
but now with the HF from TgQ


little too busy, perhaps windy, previous images were using TgQ norms

using norms it seemed water needed to at least touch the tile.
using HF I had a dark wall if not overlapping


Post a reply to this message


Attachments:
Download 'lego_pool_hf.png' (323 KB)

Preview of image 'lego_pool_hf.png'
lego_pool_hf.png


 

From: Trevor G Quayle
Subject: Re: Bathtub - take 2
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

From: Trevor G Quayle
Subject: Re: Bathtub - take 2
Date: 20 Dec 2008 22:10:00
Message: <web.494db29e6655db18c67b294d0@news.povray.org>
one more correction, replace PX in the previous with:

#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>
}


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Bathtub - take 2
Date: 20 Dec 2008 22:10:00
Message: <web.494db3286655db18c67b294d0@news.povray.org>
"alphaQuad" <alp### [at] earthlinknet> wrote:
> "Cousin Ricky" <ric### [at] yahoocom> wrote:
> >
> > > I doubt anyone can.
> >
> > Very fragile generalization.
> >
> you got me, I'm smarter than that, I was fishing and caught a bite
>
> whoa both my fav water ppl in one day.
>
> this is Cousin Ricky absorption, as they all have been
> but now with the HF from TgQ
>
>
> little too busy, perhaps windy, previous images were using TgQ norms
>
> using norms it seemed water needed to at least touch the tile.
> using HF I had a dark wall if not overlapping

The busyness appears to be coming from refraction of the tile pattern.

Yes, make sure the water is *slightly* larger than the pool hole to avoid
coincident surfaces.

-tgq


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Bathtub - take 2
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

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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