POV-Ray : Newsgroups : povray.general : Height_field help Server Time
29 Feb 2024 02:31:20 EST (-0500)
  Height_field help (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Leroy
Subject: Re: Height_field help
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

From: Kenneth
Subject: Re: Height_field help
Date: 7 Mar 2023 16:35:00
Message: <web.6407acda3575e8099b4924336e066e29@news.povray.org>
"Leroy" <whe### [at] gmailcom> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
>
> > But about the original macro here: I still cannot get it to run...
>
> 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.
>
Aha! I didn't even notice that mis-matched capital S; I was looking for a deeper
and more obscure problem, ha. It runs fine now. Thanks.

But take a look at your posted code at the beginning of the thread:

>
> How to use:
>
> #declare FileStr="Image.tga"
>
> height_field{Image(Filestr} ...

Oops! ;-)


Post a reply to this message

From: Leroy
Subject: Re: Height_field help
Date: 8 Mar 2023 11:00:00
Message: <web.6408b0eb3575e809a65a2a95f712fc00@news.povray.org>
My bad!


Post a reply to this message

From: Leroy
Subject: Re: Height_field help
Date: 9 Mar 2023 18:50:00
Message: <web.640a70223575e80993374911f712fc00@news.povray.org>
"Leroy" <whe### [at] gmailcom> wrote:
> My bad!
Sorry for the short short comment. I did it from my cell phone and you know I
got a call in the middle of it.
 I was careful with copying the macro and placing the examples then I changed to
'FileStr' from the 'I_file' it was named. Though it would read better. Then I
made the dumb mistake (I make this kind too often). When you said you had a
problem I was like you I and looked at the macro not the examples until the very
last.

Getting someone to understand something is harder than doing it yourself!

Have fun!


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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