Previous:Vector Literals   Main Index   Next:Vector Operators



Vector Identifiers

Vector identifiers may be declared to make scene files more readable and to parameterize scenes so that changing a single declaration changes many values. An identifier is declared as follows.

VECTOR_DECLARATION:
#declare IDENTIFIER = EXPRESSION; |
#local IDENTIFIER = EXPRESSION;

Where IDENTIFIER is the name of the identifier up to 40 characters long and EXPRESSION is any valid expression which evaluates to a vector value. Note that there should be a semi-colon after the expression in a vector declaration. This semi-colon is new with POV-Ray version 3.1. If omitted, it generates a warning and some macros may not work properly. See "#declare vs. #local" for information on identifier scope. Here are some examples....

 #declare Here = <1,2,3>;

 #declare There = <3,4,5>;

 #declare Jump = <Foo*2,Bar-1,Bob/3>;

 #declare Route = There-Here;

 #declare Jump = Jump+<1,2,3>;

Note that you invoke a vector identifier by using its name without any angle brackets. As the last example shows, you can re-declare a vector identifier and may use previously declared values in that re-declaration. There are several built-in identifiers which POV-Ray declares for you. See section "Built-in Vector Identifiers" for details.



Previous:Vector Literals   Main Index   Next:Vector Operators