POV-Ray : Newsgroups : povray.general : Height_field help : Re: Height_field help Server Time
2 May 2024 23:06:39 EDT (-0400)
  Re: Height_field help  
From: Leroy
Date: 7 Mar 2023 16:05:00
Message: <web.64079cb43575e809ae5a9500f712fc00@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> But about the original macro here: I still cannot get it to run, despite
> fiddling with various parts. I don't know if the following experiment is
> helpful, but for the very beginning of the code, I added a few things to see
> what would happen:
>
> #macro Image(File)
>  #local L=strlen(File);
>  #debug concat("\n","L = ",str(L,0,3),"\n")
>  #error
> ....
> #end
>
> Then, same as before...
> #declare FileStr= "test image for hf png.png"
> height_field{Image(Filestr)}
>
> I half-way expected to at least get a #debug output for L=strlen(File), then a
> halt to the whole process-- but no #debug message shows up, just the previous
> error of "Cannot pass unitialized identifier as macro parameter..."
>

The secrete here is the error line

 Cannot pass unitialized identifier as macro ''parameter''...

The only macro parameter we have here is 'Filestr' ie.. Image(Filestr) FileStr
is what you declare earlier. Notice the capital S. 'Filestr' doesn't exists.
That's the only problem I see.

But I did go over the Image macro with a fine tooth comb. And found some things
that could work better. I added the "pot" image type. And put an error if no
image type was found.
 While combing I found that Image("file.ppm") works fine.

> Leroy, does your macro *as written in this newsgroup thread* run OK on your own
> system? (with the minor fix of the added parentheses, that is)

The macro runs fine on my pov 3.7 winXP. I usually don't #include a file with a
single macro on it, I copy the macro and paste it in the project I'm working on.
I've used that macro roughly 80 times on the current project. I copied it from
there and put it here. It should work fine. The examples not so much...

Have Fun!


Post a reply to this message

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