POV-Ray : Newsgroups : povray.general : concat for variable identifier? : Re: concat for variable identifier? Server Time
6 Aug 2024 14:15:39 EDT (-0400)
  Re: concat for variable identifier?  
From: Sebastian H 
Date: 3 Mar 2002 16:21:55
Message: <3C82945A.7010109@web.de>
I took a look at theses functions too but the only one that does it was 
the macro Christoph Hormann suggested.


The problem comes from here:

Im writing a model converter for the .md3 format (some games use it).

Since each file contains several Meshframes I store each frame in a 
single file which is included by a macro

#macro MODELNAME_load_frame (frame)
...
#end

The vertex vectors for example are stored in an array (as the normals too)

#declare MODELNAME_vv = array[xxx] {
...
}

Now I tried to write a macro that puts spheres on every vertex (for 
testing and for coolness :-) ).

And here's the same problem I can't access the MODELNAME_vv array just 
by giving a macro just the modelname and I don't want to write the same 
macro for every model.

Using the parse_string macro could give something like that:

#declare num = 1; // Or so doesn't matter
#declare Vec =
parse_string ( concat (MODELNAME, "_vv[", str (num, 0, 0), "];") )

I didn't tried it but that should work.

Sebastian H.

P.S.: Hmm I should try it!


Post a reply to this message

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