POV-Ray : Newsgroups : povray.unofficial.patches : Square and triangular pattern : Re: Square and triangular pattern Server Time
3 Sep 2024 00:14:36 EDT (-0400)
  Re: Square and triangular pattern  
From: Nieminen Juha
Date: 1 Sep 1999 10:57:20
Message: <37cd3ed0@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
: Regardless the fact the you and Warp, both advanced users, can figure out
: a somewhat complicated method of rendering this pattern, does not make
: it intuitively obvious to others and I doubt less than 10% of all Pov
: users could do it themselves. Patches are for more than mere convenience
: of parsing speed and memory effeciency.

  If we add a patch to povray every time someone wants his own pattern
type, povray would grow wildly and there would be a lot more maintenance
problems.
  If someone doesn't know how to get the desired pattern, he sould learn
how to use povray ;)

:> By the way, Warp, the squares could also be done with a repeat warp,
:> which would eliminate the problem that happens with the gradient version
:> near zero.

: Yeah warp listen to papa :)

  Ok, here it is. This should be faster than the gradient-version:

#macro Squares(p1,p2,p3,p4)
  checker
  pigment
  { checker pigment { p1 }, pigment { p2 }
    scale <.5,1,1>
  }
  pigment
  { checker pigment { p4 }, pigment { p3 }
    scale <.5,1,1>
  }
  scale <1,.5,1>*2
  warp { repeat 2*x }
#end

#declare P1=pigment { rgb x }
#declare P2=pigment { wood turbulence .5 scale .4 }
#declare P3=pigment { granite scale .5 }
#declare P4=pigment { rgb z }
camera { location -z*7 look_at 0 }
plane
{ -z,0 pigment { Squares(P1,P2,P3,P4) }
  finish { ambient 1 }
}

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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