|
|
"Slime" <fak### [at] emailaddress> wrote:
> By any chance, are you passing variables "by reference" into macros? (So
> that the macros change their values?)
Yes, I'm passing variables to macross to be set by those macros. I declare
them outside the macro to be zero before the macro is called. At the
beginning of my code I have:
#declare Bike1x = 0;
#declare Bike1z = 0;
#declare Bike1Forward = <1,0,0>;
#declare Bike1Color = Red;
#declare Bike2x = 0;
#declare Bike2z = 0;
#declare Bike2Forward = <1,0,0>;
#declare Bike2Color = Orange;
#declare Bike3x = 0;
#declare Bike3z = 0;
#declare Bike3Forward = <1,0,0>;
#declare Bike3Color = Blue;
#declare Bike4x = 0;
#declare Bike4z = 0;
#declare Bike4Forward = <1,0,0>;
#declare Bike4Color = Orange;
I then have my macros followed by:
JetWall (path1,bike_height,wall_width,Bike1Color,Bike1x,Bike1z,Bike1Forward)
JetWall (path2,bike_height,wall_width,Bike2Color,Bike2x,Bike2z,Bike2Forward)
JetWall (path3,bike_height,wall_width,Bike3Color,Bike3x,Bike3z,Bike3Forward)
JetWall (path4,bike_height,wall_width,Bike4Color,Bike4x,Bike4z,Bike4Forward)
#declare Spokes = (frame_number/2=int(frame_number/2));
LightCycle(Bike1x,Bike1z,Bike1Forward,Bike1Color,Spokes,135,155)
LightCycle(Bike2x,Bike2z,Bike2Forward,Bike2Color,Spokes,155,185)
LightCycle(Bike3x,Bike3z,Bike3Forward,Bike3Color,Spokes,165,125)
LightCycle(Bike4x,Bike4z,Bike4Forward,Bike4Color,Spokes,35,195)
JetWall is a macro that draws the wall following the bike and calculates the
location (Bike#x and Bike#z) and forward direction (Bike#Foward) Those
values are then passed to the macro LightCycle that draws the Bike itself.
I'm not 100% sure what you mean by "by reference".
Thanks,
Carl
Post a reply to this message
|
|