POV-Ray : Newsgroups : povray.programming : Request: new pigment Server Time
29 Jul 2024 02:27:57 EDT (-0400)
  Request: new pigment (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: Ronald L  Parker
Subject: Re: Request: new pigment
Date: 6 Apr 1999 23:44:28
Message: <370cc376.28317605@news.povray.org>
/*
On Tue, 06 Apr 1999 19:29:49 -0400, Anthony Bennett
<ben### [at] panamaphoenixnet> wrote:

>Wouldn't it just be easier and faster to have a predetermined pigment like
>that? If not, then bring on the macro!

No sooner said than done (I had already been working on it.)  Just
paste this whole article into POV and render.  Scale is a little
funky--the hexes are one unit from point to point.  That makes the
calculation of mortar thickness a little tricky but not impossible.
Just divide the thickness you want by .866 and subtract from 1 to
get the cutoff to use in the color_map.

Indentation is ignored for the sake of compactness.  Either that or
Tyler Syndrome is contagious.
*/

#macro HexTiles( Map )                                           
  #local hexGrad=pigment { gradient x 
  color_map {Map} scale sqrt(3)/2+.0001}
  #local hexBlock=pigment { radial pigment_map{
  #local i=0; #while (i<6)
  [i/6 hexGrad rotate (30+60*i)*y] 
  [(i+1)/6 hexGrad rotate (30+60*i)*y]
  #local i=i+1; #end}}
  radial pigment_map {
    [0/3 hexBlock translate <.5,0,-sqrt(3)/2>]
    [1/3 hexBlock translate <.5,0,-sqrt(3)/2>]
    [1/3 hexBlock translate <-1,0,0>]
    [2/3 hexBlock translate <-1,0,0>]
    [2/3 hexBlock translate <.5,0,sqrt(3)/2>]
    [3/3 hexBlock translate <.5,0,sqrt(3)/2>]
  }
  translate x 
  warp {repeat 1.5*x flip x} 
  warp {repeat .5*sqrt(3)*z flip z}
  scale .5
#end

plane { y,0
  pigment {HexTiles(color_map{[.95 red .7] [.95 rgb 1]})}
}

camera { location 12*y sky z look_at 0 }
light_source { 6*y rgb 1}


Post a reply to this message

From: Ken
Subject: Re: Request: new pigment
Date: 7 Apr 1999 01:00:15
Message: <370AD720.381E30E5@pacbell.net>
Ronald L. Parker wrote:

> Indentation is ignored for the sake of compactness.

As it should be in all cases.

>  Either that or Tyler Syndrome is contagious.

I can only hope.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Anthony Bennett
Subject: Re: Request: new pigment
Date: 7 Apr 1999 08:36:39
Message: <370B2038.934B0D87@panama.phoenix.net>

(I hope you can read spanish.)


Post a reply to this message

From: Ron Parker
Subject: Re: Request: new pigment
Date: 7 Apr 1999 12:44:41
Message: <370b7d69.0@news.povray.org>
On Wed, 07 Apr 1999 02:41:24 GMT, Ronald L. Parker <par### [at] mailfwicom> wrote:
>No sooner said than done (I had already been working on it.)  Just
>paste this whole article into POV and render.  Scale is a little
>funky--the hexes are one unit from point to point.  That makes the
>calculation of mortar thickness a little tricky but not impossible.
>Just divide the thickness you want by .866 and subtract from 1 to
>get the cutoff to use in the color_map.

Just a side note... if you remove the 'scale .5' at the end, the
pattern coincides perfectly with the 'hexagons' pigment type, so
you can use transparency in your color map to see through to some
nice pigment-mapped stone hexagons.  Of course, none of this is
actually germane to povray.programming, except in that it's saved
us from having to do any programming on POV. :)


Post a reply to this message

From: Nieminen Mika
Subject: Re: Request: new pigment
Date: 7 Apr 1999 14:55:35
Message: <370b9c17.0@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
:> Indentation is ignored for the sake of compactness.

: As it should be in all cases.

  If I stop using indentation in my pov code, will you help me to debug the
code next year, when I want to fix it or convert it to the new povray?

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

From: Anthony Bennett
Subject: Re: Request: new pigment
Date: 8 Apr 1999 00:22:05
Message: <370BFDFF.55B70572@panama.phoenix.net>
Can this pigment be used as a normal?


Post a reply to this message

From: Ron Parker
Subject: Re: Request: new pigment
Date: 8 Apr 1999 10:35:25
Message: <370cb09d.0@news.povray.org>
On Wed, 07 Apr 1999 20:53:20 -0400, Anthony Bennett wrote:
>Can this pigment be used as a normal?

You'll have to do some rewriting here and there, since the words 'pigment'
and 'pigment_map' are scattered liberally throughout, but all of the math
would remain the same.


Post a reply to this message

From: Alberto Mendoza
Subject: Re: Request: new pigment
Date: 9 Apr 1999 00:00:26
Message: <370D6D12.1DE932C6@usb.ve>
"Ronald L. Parker" wrote:...

Well done!.  Playing with the macro I discovered that it works as well if

//    [0/3 hexBlock translate <.5,0,-sqrt(3)/2>]
    [1/3 hexBlock translate <.5,0,-sqrt(3)/2>]
    [1/3 hexBlock translate <-1,0,0>]
    [2/3 hexBlock translate <-1,0,0>]
    [2/3 hexBlock translate <.5,0,sqrt(3)/2>]
//    [3/3 hexBlock translate <.5,0,sqrt(3)/2>]

Alberto


Post a reply to this message

From: Ron Parker
Subject: Re: Request: new pigment
Date: 9 Apr 1999 10:28:34
Message: <370e0082.0@news.povray.org>
On Thu, 08 Apr 1999 22:59:31 -0400, Alberto Mendoza <jac### [at] usbve> wrote:
>
>
>"Ronald L. Parker" wrote:...
>
>Well done!.  Playing with the macro I discovered that it works as well if
>
>//    [0/3 hexBlock translate <.5,0,-sqrt(3)/2>]
>    [1/3 hexBlock translate <.5,0,-sqrt(3)/2>]
>    [1/3 hexBlock translate <-1,0,0>]
>    [2/3 hexBlock translate <-1,0,0>]
>    [2/3 hexBlock translate <.5,0,sqrt(3)/2>]
>//    [3/3 hexBlock translate <.5,0,sqrt(3)/2>]
>
>Alberto

Good point.  You can also replace those four remaining lines with

#local i=1; #while (i<=2) 
  [i/3 hexBlock translate vrotate(x,(120*i-60)*y)]
  [i/3 hexBlock translate vrotate(x,(120*i+60)*y)]
#local i=i+1; #end

The only advantage to this is that it might make the .5's and sqrt(3)'s a 
little less cryptic and/or intimidating.


Post a reply to this message

From: Alberto Mendoza
Subject: Re: Request: new pigment
Date: 11 Apr 1999 01:46:42
Message: <37102905.23982698@usb.ve>
Ron Parker wrote:
>...You can also replace those four remaining lines with
> 
> #local i=1; #while (i<=2)
>   [i/3 hexBlock translate vrotate(x,(120*i-60)*y)]
>   [i/3 hexBlock translate vrotate(x,(120*i+60)*y)]
> #local i=i+1; #end
> 
> The only advantage to this is that it might make the .5's and sqrt(3)'s a
> little less cryptic and/or intimidating.

and the symmetries become more apparent.


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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