POV-Ray : Newsgroups : povray.binaries.images : Am I just too stupid to POV? : Re: Am I just too stupid to POV? Server Time
5 Nov 2024 06:20:56 EST (-0500)
  Re: Am I just too stupid to POV?  
From: Art Flint
Date: 27 Oct 2005 14:29:46
Message: <43611c9a$1@news.povray.org>
Yadgar wrote:
> High!
> 
> In between, I'm trying to program a macro for generating joined bezier 
> patches from heightfield bitmaps... but even reading out the pixel data 
> from a small test image fails!
> 
> bicubic_patch
> {
>   type 0
>   #declare a=0;
>   #while (a<4)
>     #declare b=0;
>     #while (b<4)
>       // <5+b*10, eval_pigment(patch, <1/8+b/4, 7/8-a/4, 
> 0>).red*50+eval_pigment(patch, <1/8+b/4, 7/8-a/4, 0>).green*(50/256), 
> 35-a*10>
>       #warning str(eval_pigment(patch, <1/8+b/4, 7/8-a/4, 0>.red, 0, 3);
>       #if (b<3 | a<3)
>         ,
>       #end
>       #declare b=b+1;
>     #end
>     #declare a=a+1;
>   #end
>   texture
>   {
>     pigment { color rgb <1, 0.5, 0> }
>     finish { ambient 0.2 diffuse 1 brilliance 0.4 }
>   }
> }
> 

Without the rest of the code, it is kind of hard to test, but maybe this 
is better: (pay no attention to the style, it's just me)
bicubic_patch
   {
   type 0
   #declare a=0;
   #while (a<4)
     #declare b=0;
     #while (b<4)
// removed "//" from infront of <5+b*10......
         <
         5+b*10,
         eval_pigment(patch, <1/8+b/4, 7/8-a/4, 0>).red*50
            +eval_pigment(patch, <1/8+b/4, 7/8-a/4, 0>).green*(50/256),
         35-a*10
         >
// added ")" here >>-----------------------------------------> 
#warning str(eval_pigment(patch, <1/8+b/4, 7/8-a/4, 0>).red, 0, 3);
       #if (b<3 | a<3)	 , #end
       #declare b=b+1;
     #end
   #declare a=a+1;
   #end
   texture{
          pigment { color rgb <1, 0.5, 0> }
          finish  { ambient 0.2 diffuse 1 brilliance 0.4 }
          }
   }


Post a reply to this message

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