POV-Ray : Newsgroups : povray.binaries.images : Am I just too stupid to POV? Server Time
8 Aug 2024 04:08:16 EDT (-0400)
  Am I just too stupid to POV? (Message 1 to 5 of 5)  
From: Yadgar
Subject: Am I just too stupid to POV?
Date: 27 Oct 2005 02:58:22
Message: <4360A4A1.7030704@gmx.de>
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 }
   }
}

Whenever I try to run this, I get the message "')' expected, float 
function 'float constant' found instead", with the #warning... line and 
line 630 in functions.inc highlighted!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Tim Nikias
Subject: Re: Am I just too stupid to POV?
Date: 27 Oct 2005 03:12:05
Message: <43607dc5@news.povray.org>
Looks like you're missing a bracket (like the warning says, just the place
it says so is wrong):

> #warning str(eval_pigment(patch, <1/8+b/4, 7/8-a/4, 0>.red, 0, 3);

Where do you close eval_pigment or str?

-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Yadgar
Subject: Re: Am I just too stupid to POV?
Date: 27 Oct 2005 03:26:51
Message: <4360AB4D.2090308@gmx.de>
High!

Tim Nikias schrieb:
> Looks like you're missing a bracket (like the warning says, just the place
> it says so is wrong):
> 
> 
>>#warning str(eval_pigment(patch, <1/8+b/4, 7/8-a/4, 0>.red, 0, 3);
> 
> 
> Where do you close eval_pigment or str?

Yes, I see... but even when I close eval_pigment correctly, I get the 
message "Bad operands for period operator" in line 629 of functions.inc!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Tek
Subject: Re: Am I just too stupid to POV?
Date: 27 Oct 2005 03:36:01
Message: <43608361$1@news.povray.org>
Well, firstly your vector is commented out, there's a // before the <

But assuming that's just a typo when you posted the message, I think this is 
a problem with pov's bicubic patch syntax. I had a similar thing when I was 
trying to write some code to generate triangles. It seems pov doesn't like 
evaluating variables for control points like that. The only way round it I 
found was to write the values out to a file then #include it. So hopefully 
I'm missing something and someone here can come up with a better solution.

Of course, your problem might be something else entirely...

Tek
http://evilsuperbrain.com


"Yadgar" <yaz### [at] gmxde> wrote in message news:436### [at] gmxde...
> 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 }
>   }
> }
>
> Whenever I try to run this, I get the message "')' expected, float 
> function 'float constant' found instead", with the #warning... line and 
> line 630 in functions.inc highlighted!
>
> See you in Khyberspace!
>
> Yadgar
>


Post a reply to this message

From: Art Flint
Subject: Re: Am I just too stupid to POV?
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.