POV-Ray : Newsgroups : povray.programming : Request: new pigment Server Time
29 Jul 2024 06:20:00 EDT (-0400)
  Request: new pigment (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Anthony Bennett
Subject: Request: new pigment
Date: 6 Apr 1999 18:17:24
Message: <370A56F6.8D88A75E@panama.phoenix.net>
Hi. I was wondering if someone could add a new pigment to POV. I don't
know if it's me or what, but I have noticed that an often used and
somewhat cool-looking pigment is what I call a "hexagon-brick". That is
how I can best describe it. It has hexagons, but separated by larger
hexagons, sort of like the brick pigment. It could be used to make
screen doors, and whatnot. Can this be done? I was thinking of a syntax
like:

pigment
{
 hexabrick COLOR_1, COLOR_2
 [mortar Size]
}

See? It's just like brick, but without a size, since they would be your
average hexagons and there's no need to strech them. Maybe it could be
left in anyway.


Post a reply to this message

From: Ron Parker
Subject: Re: Request: new pigment
Date: 6 Apr 1999 19:07:46
Message: <370a85b2.0@news.povray.org>
On Tue, 06 Apr 1999 14:48:23 -0400, Anthony Bennett wrote:
>Hi. I was wondering if someone could add a new pigment to POV. I don't
>know if it's me or what, but I have noticed that an often used and
>somewhat cool-looking pigment is what I call a "hexagon-brick". That is
>how I can best describe it. It has hexagons, but separated by larger
>hexagons, sort of like the brick pigment. It could be used to make
>screen doors, and whatnot. Can this be done? I was thinking of a syntax
>like:
>
>pigment
>{
> hexabrick COLOR_1, COLOR_2
> [mortar Size]
>}
>
>See? It's just like brick, but without a size, since they would be your
>average hexagons and there's no need to strech them. Maybe it could be
>left in anyway.

I'd rather see it be more like crackle, where the value of the pattern
(not pigment) at a point is proportional to the "distance" of the point
from the nearest "hex center" where "distance" is defined as the radius
of the hexagon centered on that center, passing through the point, and 
"aligned" with the boundary hexes.  Come to think of it, I'd like to see 
the same thing with squares, cubes, and triangles (I think that exhausts 
the tileable polygons and polyhedra)

The result would be that you could get "mortar" by using an appropriate
color, pigment, or texture map, and you could use them as normals as well.

By the way, it is possible to fake any of these with appropriate use of 
gradients and repeat warps, so they could be implemented as macros.


Post a reply to this message

From: Anthony Bennett
Subject: Re: Request: new pigment
Date: 6 Apr 1999 22:58:58
Message: <370A98ED.A96C58A5@panama.phoenix.net>
Wouldn't it just be easier and faster to have a predetermined pigment like
that? If not, then bring on the macro!


Post a reply to this message

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

Goto Latest 10 Messages Next 3 Messages >>>

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