POV-Ray : Newsgroups : povray.general : Can I get the coordinate? : Re: Can I get the coordinate? Server Time
29 Jul 2024 22:24:44 EDT (-0400)
  Re: Can I get the coordinate?  
From: Alain
Date: 10 Jul 2010 21:39:57
Message: <4c3920ed$1@news.povray.org>

> Le_Forgeron<jgr### [at] freefr>  wrote:
>
>> No problem with your english.
>> Have a look at the brick pattern
>>   http://f-lohmueller.de/pov_tut/tex/tex_550e.htm
>>
>> from above, it will be what you want.
>> (there is other way to do it, including warp and other patterns)
>>
>> Now, you can also really tile a floor (plane) with actual tiles (box),
>> using two loops to cover the visible area.
>
> Well, I just somewhat be not willing to do this with so many boxes. And I want
> to learn more about POV-Ray's SDL, and what it can do. But I can't find that in
> the document.
>
> Thank you.
>
>
To place many tiles/boxes, you can easily use nested #while() loops
Sample:
union{ // place 1600 tiles
#declare IndX = -20;
#declare MaxX = 20;
#declare MaxZ = 20;
#while(IndX < MaxX)
   #declare IndZ = -20;
   #while(IndZ < MaxZ)
    box{<0.45,0.02,0.45>,<-0.45,-0.1, -0.45> translate <IndX, 0, IndZ>}
    #declare IndZ = IndZ + 1;
   #end
   #declare IndX = IndX +1;
#end
plane{y, 0 pigment{rgb 0.05}}// grout between the tiles
pigment{rgb 1}
}

You can also use layered textures on a plane:

texture{pigment{gradient z color_map{[0.1 rgb 0.05][0.1 rgb 1]}
// white base with black stripes
texture{pigment{gradient z color_map{[0.1 rgb 0.05][0.1 rgbt 1]}
// second set of black stripes
// The transparent part let the previous layer be visible



Alain


Post a reply to this message

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