POV-Ray : Newsgroups : povray.binaries.images : pigment checker color1 color2... color 3 : Re: pigment checker color1 color2... color 3 Server Time
4 Nov 2024 17:55:30 EST (-0500)
  Re: pigment checker color1 color2... color 3  
From: Abe
Date: 15 Feb 2006 16:20:01
Message: <web.43f39af6694ce5897b6f9a0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> Wasn't it B. Gimeno who wrote:
> >This one is an image made with an old version of pov-ray.
> >
> >The pigment is very simple.
> >pigment {
> >  checker
> >    color 1
> >    color 2
> >    color 3
> >    ...
> >}
> >
> >How could be made TODAY this effect avoiding error messages?
>
> box {-4.999,4.999
>   pigment {
>     function {(floor(x)+floor(y)+floor(z))/3}
>     colour_map{
>       [0/3 rgb x]
>       [1/3 rgb y]
>       [2/3 rgb z]
>       [3/3 rgb x]
>     }
>   }
> }
>
>
> The .999's are there to prevent the colour changes happening exactly on
> a face or edge, which cause the pigment equivalent of coincident
> surfaces.
>
> --
> Mike Williams
> Gentleman of Leisure

So elegant and concise!

My own solution was at least five times longer.
Learned something again.

Abe


Post a reply to this message

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