POV-Ray : Newsgroups : povray.advanced-users : pigment from array : Re: pigment from array Server Time
3 Jul 2024 05:19:53 EDT (-0400)
  Re: pigment from array  
From: clipka
Date: 11 Mar 2009 22:20:00
Message: <web.49b8705ffdedc854801985dd0@news.povray.org>
stbenge <^@hotmail.com> wrote:
> At the risk of missing the point entirely and/or saying something
> stupid, I present this code:

You're *not* missing the point; in fact, from a quick glance at the code this
one seems to perfectly hit the mark:

> // read from array into a pigment
> #declare hfHeight=
> pigment{
>   pigment_pattern{planar translate y}
>   pigment_map{
>    #declare V=0;
>    #while(V<hfRes.y)
>     [V/hfRes.y
>      planar rotate z*90 translate x
>      color_map{
>       #declare U=0;
>       #while(U<hfRes.x)
>        [U/hfRes.x
>         rgb hfPts[U][V]
>        ]
>        #declare U=U+1;
>       #end
>      }
>     ]
>     #declare V=V+1;
>    #end
>   }
> }

Asked for a smart solution - got one as it seems; thanks a lot!


Post a reply to this message

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