Previous:Operator Promotion   Main Index   Next:Vector Functions



Built-in Vector Identifiers

There are several built-in vector identifiers. You can use them to specify values or to create expressions but you cannot re-declare them to change their values. They are:

VECTOR_BUILT-IN_IDENT:
x | y | z | t | u | v

All built-in vector identifiers never change value. They are defined as though the following lines were at the start of every scene.

 #declare x = <1, 0, 0>;

 #declare y = <0, 1, 0>;

 #declare z = <0, 0, 1>;

 #declare t = <0, 0, 0, 1>;

 #declare u = <1, 0>;

 #declare v = <0, 1>;

The built-in vector identifiers x, y, and z provide much greater readability for your scene files when used in vector expressions. For example....

 plane { y, 1}    // The normal vector is obviously "y".

 plane { <0,1,0>, 1} // This is harder to read.

 translate 5*x    // Move 5 units in the "x" direction.

 translate <5,0,0>  // This is less obvious.

An expression like 5*x evaluates to 5*<1,0,0> or <5,0,0>.

Similarly u and v may be used in 2D vectors. When using 4D vectors you should use x, y, z, and t and POV-Ray will promote x, y, and z to 4D when used where 4D is required.



Previous:Operator Promotion   Main Index   Next:Vector Functions