POV-Ray : Newsgroups : povray.general : checkered passed Server Time
8 Aug 2024 18:13:07 EDT (-0400)
  checkered passed (Message 1 to 10 of 27)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Rick Mabry
Subject: checkered passed
Date: 15 Nov 2000 00:00:44
Message: <3a12187c$1@news.povray.org>
The checker pattern gives:

ABABABAB
BABABABA
ABABABAB
BABABABA

But what is the best way to obtain

ABCABCABCABC
BCABCABCABCA
CABCABCABCAB
ABCABCABCABC
BCABCABCABCA

and other  general checker patterns? Must these be done "by hand" using
loops?

Thanks,

Rick Mabry


Post a reply to this message

From: Chris Colefax
Subject: Re: checkered passed
Date: 15 Nov 2000 01:42:38
Message: <3a12305e@news.povray.org>
Rick Mabry <rma### [at] softdiskcom> wrote:
> The checker pattern gives:
>
> ABABABAB
> BABABABA
> ABABABAB
> BABABABA
>
> But what is the best way to obtain
>
> ABCABCABCABC
> BCABCABCABCA
> CABCABCABCAB
> ABCABCABCABC
> BCABCABCABCA
>
> and other  general checker patterns? Must these be done "by hand" using
> loops?

POV-Ray includes the hexagon pattern, which tiles three colours, pigments,
textures, etc. using (duh!) hexagons.  If you want other tiled patterns you
should be able to use repeat warps (best for flat colours) and/or nested
patterns, e.g. a macro to create the tiling pattern you've shown above:

   #macro checker_pigment (Pigment1, Pigment2, Pigment3)
      gradient y pigment_map {
         [1/3 gradient x pigment_map {
            [1/3 Pigment1] [1/3 Pigment2] [2/3 Pigment2] [2/3 Pigment3]}
            ]
         [1/3 gradient x pigment_map {
            [1/3 Pigment3] [1/3 Pigment1] [2/3 Pigment1] [2/3 Pigment2]}
            ]
         [2/3 gradient x pigment_map {
            [1/3 Pigment3] [1/3 Pigment1] [2/3 Pigment1] [2/3 Pigment2]}
            ]
         [2/3 gradient x pigment_map {
            [1/3 Pigment2] [1/3 Pigment3] [2/3 Pigment3] [2/3 Pigment1]}
            ]
         }
         scale 3
   #end

   plane {z, 20
      pigment {checker_pigment (rgb x, rgb y, rgb z) translate -100}
      finish {ambient 1 diffuse 0}
      }

This macro can be easily modified for tiling complete textures, and extended
into the third dimension (z) if needed.  The only thing to note is that the
gradient pattern is symmetrical around the origin, so the tiling breaks
along the x and y axes.  This is easily avoided by translating the pattern
origin out of view.


Post a reply to this message

From: Peter Popov
Subject: Re: checkered passed
Date: 15 Nov 2000 03:53:55
Message: <43j41to7vtl4goh03jmirl4a8mn4ltted5@4ax.com>
On Wed, 15 Nov 2000 16:42:06 +1000, "Chris Colefax"
<chr### [at] tagpovrayorg> wrote:

>This macro can be easily modified for tiling complete textures, and extended
>into the third dimension (z) if needed.  The only thing to note is that the
>gradient pattern is symmetrical around the origin, so the tiling breaks
>along the x and y axes.  This is easily avoided by translating the pattern
>origin out of view.

How about using marble with ramp_wave?


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Ron Parker
Subject: Re: checkered passed
Date: 15 Nov 2000 09:32:07
Message: <slrn9157jd.6sa.ron.parker@fwi.com>
On Wed, 15 Nov 2000 16:42:06 +1000, Chris Colefax wrote:
>This macro can be easily modified for tiling complete textures, and extended
>into the third dimension (z) if needed.  The only thing to note is that the
>gradient pattern is symmetrical around the origin, so the tiling breaks
>along the x and y axes.  This is easily avoided by translating the pattern
>origin out of view.

Or using a repeat warp, which is how I would have done it.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Ron Parker
Subject: Re: checkered passed
Date: 15 Nov 2000 09:37:52
Message: <slrn9157u6.6sa.ron.parker@fwi.com>
On 15 Nov 2000 09:32:07 -0500, Ron Parker wrote:
>On Wed, 15 Nov 2000 16:42:06 +1000, Chris Colefax wrote:
>>This macro can be easily modified for tiling complete textures, and extended
>>into the third dimension (z) if needed.  The only thing to note is that the
>>gradient pattern is symmetrical around the origin, so the tiling breaks
>>along the x and y axes.  This is easily avoided by translating the pattern
>>origin out of view.
>
>Or using a repeat warp, which is how I would have done it.

That is,

 #macro checker_pigment (Pigment1, Pigment2, Pigment3)
         gradient x pigment_map {
            [1/3 Pigment1] [1/3 Pigment2] [2/3 Pigment2] [2/3 Pigment3]}
         warp {repeat x}
         warp {repeat y offset 1/3*x}
         scale <3,1,1>
   #end



-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Rick Mabry
Subject: Re: checkered passed
Date: 15 Nov 2000 11:59:46
Message: <3a12c102@news.povray.org>
Thanks for the macro suggestions. They both worked great for color pigments.
I am trying to modify them to allow for image_maps --- at present they do
not seem to accomodate these (due to stretching and such).

Rick

"Ron Parker" <ron### [at] povrayorg> wrote in message
news:slr### [at] fwicom...
> On 15 Nov 2000 09:32:07 -0500, Ron Parker wrote:
> >On Wed, 15 Nov 2000 16:42:06 +1000, Chris Colefax wrote:
> >>This macro can be easily modified for tiling complete textures, and
extended
> >>into the third dimension (z) if needed.  The only thing to note is that
the
> >>gradient pattern is symmetrical around the origin, so the tiling breaks
> >>along the x and y axes.  This is easily avoided by translating the
pattern
> >>origin out of view.
> >
> >Or using a repeat warp, which is how I would have done it.
>
> That is,
>
>  #macro checker_pigment (Pigment1, Pigment2, Pigment3)
>          gradient x pigment_map {
>             [1/3 Pigment1] [1/3 Pigment2] [2/3 Pigment2] [2/3 Pigment3]}
>          warp {repeat x}
>          warp {repeat y offset 1/3*x}
>          scale <3,1,1>
>    #end


Post a reply to this message

From: Rick Mabry
Subject: Re: checkered passed
Date: 15 Nov 2000 12:33:58
Message: <3a12c906$1@news.povray.org>
Something seems strange in the documentation. In the section "Pigment Maps
and Pigment Lists," there is the statement:

`You may not use pigment_map or individual pigments with an image_map. See
section "Texture Maps" for an alternative way to do this.'

Even though image_maps didn't give me just what I wanted (yet), an image was
rendered using the image_maps I provided.

Rick.

"Ron Parker" <ron### [at] povrayorg> wrote in message
news:slr### [at] fwicom...
>  #macro checker_pigment (Pigment1, Pigment2, Pigment3)
>          gradient x pigment_map {
>             [1/3 Pigment1] [1/3 Pigment2] [2/3 Pigment2] [2/3 Pigment3]}
>          warp {repeat x}
>          warp {repeat y offset 1/3*x}
>          scale <3,1,1>
>    #end


Post a reply to this message

From: Ron Parker
Subject: Re: checkered passed
Date: 15 Nov 2000 13:16:38
Message: <slrn915kob.70h.ron.parker@fwi.com>
On Wed, 15 Nov 2000 12:00:24 -0500, Rick Mabry wrote:
>Thanks for the macro suggestions. They both worked great for color pigments.
>I am trying to modify them to allow for image_maps --- at present they do
>not seem to accomodate these (due to stretching and such).

In that case, try the modification below.  Make your image maps fit in the
square from <0,0,0> to <1,1,0>.  (If you do that and make them tiled, you can
remove the translates in the macro below as well.)

>>  #macro checker_pigment (Pigment1, Pigment2, Pigment3)
>>          gradient x pigment_map {
>>             [1/3 Pigment1] [1/3 Pigment2] [2/3 Pigment2] [2/3 Pigment3]}

Replace this line with

  [1/3 Pigment1 scale <1/3,1,1>]
  [1/3 Pigment2 translate x scale <1/3,1,1>]
  [2/3 Pigment2 translate x scale <1/3,1,1>]
  [2/3 Pigment3 translate 2*x scale <1/3,1,1>]
  }

>>          warp {repeat x}
>>          warp {repeat y offset 1/3*x}
>>          scale <3,1,1>
>>    #end


-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Rick Mabry
Subject: Re: checkered passed
Date: 15 Nov 2000 15:00:28
Message: <3a12eb5c$1@news.povray.org>
"Ron Parker" <ron### [at] povrayorg> wrote in message
news:slr### [at] fwicom...

> On Wed, 15 Nov 2000 12:00:24 -0500, Rick Mabry wrote:
> >Thanks for the macro suggestions. They both worked great for color
pigments.
> >I am trying to modify them to allow for image_maps --- at present they do
> >not seem to accomodate these (due to stretching and such).

> In that case, try the modification below [snip]

Thanks, that worked nicely for the ABC/BCA/CAB version. I also modified the
macro from Chris by sprinkling some instances of "scale 1/3", after which it
worked well for image_maps.

Gratefully yours,

Rick Mabry


Post a reply to this message

From: Chris Colefax
Subject: Re: checkered passed
Date: 16 Nov 2000 01:33:53
Message: <3a137fd1@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:
> Or using a repeat warp, which is how I would have done it.

This is the first suggestion I made (see my original reply), but if
patterned pigments are used, a repeat warp will cause repeated sections of
the child patterns to render.  The macro I posted avoids this, behaving
instead like the internal checker and hexagon patterns.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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