|
|
I know that trying to call a variable before you declare it is not generally
considered very bright, but I'm attempting to understand what's going on in the
code below:
----------------------------------------
(test.pov)
#declare RdmA = seed(574647);
#include "rand2.inc"
#declare X = RRand(-5,5,RdmA);
#if (Y = 0) #end
----------------------------------------
----------------------------------------
(rand2.inc)
#macro RRand(Min, Max, RS) (rand(RS)*(Max-Min) + Min) #end
----------------------------------------
"rand2.inc" consists of a macro copied from the original "rand.inc" file. If I
run "test.pov" above, POV-Ray throws an unhandled exception and I'm forced to
close the program.
If, however, I change "test.pov" to be:
----------------------------------------
(test2.pov)
#declare RdmA = seed(574647);
#macro RRand(Min, Max, RS) (rand(RS)*(Max-Min) + Min) #end
#declare X = RRand(-5,5,RdmA);
#if (Y = 0) #end
----------------------------------------
......that is, I replace the '#include' call with the macro from "rand2.inc",
then POV produces a simple parse error, as expected.
So, what's the difference between using this macro in an include file and
placing it directly in my .pov code?
OS: WinXP
POV: 3.6.1c
Post a reply to this message
|
|