POV-Ray : Newsgroups : povray.animations : Calling an Image Map with an array identifier that stores the image file na= : Re: Calling an Image Map with an array identifier that stores the image fil= Server Time
19 Oct 2021 11:23:15 EDT (-0400)
  Re: Calling an Image Map with an array identifier that stores the image fil=  
From: Kenneth
Date: 3 Dec 2018 11:05:01
Message: <web.5c0553d4b4bd0d7acd98345b0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 03.12.2018 um 02:06 schrieb Kenneth:
>
> > That 'png' is a keyword (or sort of like one), and I could never figure
> > out a way to get a string construction to 'create' a POV-Ray keyword...
>
> See `Parse_String` macro in `strings.inc`.

Hey, that does work beautifully!

#include "Strings.inc"
image_map{
Parse_String("png") concat("my_image",str(frame_number - 1,-4,0),".png")

(although, I probably wouldn't use it in this *particular* context, as the
keyword   png   would simply be easier; but it's a great way to generate
keywords in general.) Thanks for the hint!

The macro is a nice one: It simply #writes the string to a file, then
immediately #includes that file back into the SDL code line.

But what baffles me at the moment is why it DOES work, when
     image_map{concat("png ","my_image",str(frame_number - 1,-4,0),".png")
does not-- since both constructions involve strings, in what *appears* to be a
similar way.

SO... I'm thinking that the  concat  keyword is the problem-- not specifically
concat, but that the initial image_map{  expression expects the BITMAP_TYPE to
be the first thing it sees, not some other 'thing'.  Not even  str("png")


Post a reply to this message

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