POV-Ray : Newsgroups : povray.animations : scene language question : Re: scene language question Server Time
27 Sep 2024 18:29:33 EDT (-0400)
  Re: scene language question  
From: Stephen McAvoy
Date: 31 Jan 2004 01:48:54
Message: <spjm10ta9mj463dm995nu00542895fvm4g@4ax.com>
On Fri, 30 Jan 2004 13:58:53 -0800, Peter MacMurchy <pet### [at] cpscucalgaryca>
wrote:

>How can i instantiate an object from a string whose contents are the
>text of the object's identifier?

It could be the extension, I often use incriminatingly named meshes generated by
Poser. Here is my method, please excuse the strange variable names, also there
is a bit of "logic" from when I used the clock variable and there was a problem
going from 9 to 10.

#declare Cycle01_Max = 120;                              //      Number of
frames in the cycle.

#declare F_Name = "nene_bal1303a_"       ;      //      incriminating mesh 1
#declare F_Name2 = "Suit_Bal1303a_"       ;     //      incriminating mesh 2


#if (frame_number < 1 )
                #declare Cycle01Pos = 0;     
                 #declare
Material_clock1=concat(F_Name,str(int(Cycle01Pos+0),-1,0),"_o.inc") 
                 #declare
Material_clock2=concat(F_Name2,str(int(Cycle01Pos+0),-1,0),"_o.inc") 
                #else 
                
                #declare Cycle01Pos =  mod (frame_number-1, Cycle01_Max); 
                #declare
Material_clock1=concat(F_Name,str(int(Cycle01Pos-0),-1,0),"_o.inc")
                #declare
Material_clock2=concat(F_Name2,str(int(Cycle01Pos-0),-1,0),"_o.inc")

                #end

//#include "nene_bal1303a_0_p.inc"	// This is the original line generated
by Moray.

#include "Nene_Bal1303a_0_moray_mat.inc" 
// This uses the same material map (UV mapping) for each mesh

#include Material_clock1        // This is the incriminating mesh

Regards
        Stephen


Post a reply to this message

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