prev index next 
Subroutines and Include Files 
 POV-Ray Tips, 
 Tricks, and Techniques
Parameter Passing? 
 
Lee asks: Do others have this problem with POV-Ray?  After defining an object, I want to change some aspect of it, without going back into the object itself or changing #declares.
 
Steve Demlow responds:
You can do this in a crude way using variables and #includes.  Put your object that you want to create multiple instances of into a file by itself, with the aspects that you want to change represented by variables. 
Then, in your main scene file, set the variables to the appropriate values and #include the object file.  Repeat as needed. 

For your example, put the following in "legoman.inc": 

object { 
    object {left_arm 
        rotate left_arm_angle 
    } 
    object {right_arm 
        rotate right_arm_angle 
    } 
    texture legoman_txt 
    etc. 
} 

Then in your main scene file: 

#declare left_arm_angle = <45,0,0> 
#declare right_arm_angle = <45,0,0> 
#declare legoman_txt = texture { ... } 
#include "legoman.inc"                  // Instance 1 of Legoman 

#declare right_arm_angle = <60,0,0> 
#include "legoman.inc"                  // Instance 2 of Legoman 

etc. 

See the sphereflake and Menger sponge sample files in the POV-Ray distribution for examples of this.

  1