home *** CD-ROM | disk | FTP | other *** search
- POV-Ray operates in a 3D x,y,z coordinate system. Often you will need to
- specify x, y and z values. A "vector" is a set of three float values used
- for such specification. Vectors consist of three float expressions that are
- bracketed by angle brackets < and >. The three terms are separated by com-
- mas. For example:
- <1.0, 3.2, -5.4578>
-
- The commas are necessary to keep the program from thinking that the 2nd
- term is "3.2-5.4578" and that there is no 3rd term. If you see an error
- message "Float expected but '>' found instead" it probably means two floats
- were combined because a comma was missing.
-
- The three values correspond to the x, y and z directions respectively.
- For example: the vector <1,2,3> means the point that's 1 unit to the right,
- 2 units up, and 3 units in front the center of the "universe" at <0,0,0>.
- Vectors are not always points, though. They can also refer to an amount to
- size, move, or rotate a scene element.
-
- Vectors may also be combined in expressions the same as float values.
- For example <1,2,3>+<4,5,6> evaluates as <5,7,9>. Subtraction, multiplica-
- tion and division are also performed on a term-by-term basis. You may also
- combine floats with vectors. For example 5*<1,2,3> evaluates as <5,10,15>.
-
- Sometimes POV-Ray requires you to specify floats and vectors side-by-
- side. Thus commas are required separators whenever an ambiguity might ari-
- se. For example: <1,2,3>-4 evaluates as <-3,-2,-1> but <1,2,3>,-4 is a vec-
- tor followed by a float. Vector identifiers may be declared and used any-
- where a vector can be used. See section 5.1.7 on declaring identifiers.
-
- Because vectors almost always refer to the x, y and z coordinates, POV-
- Ray has three built-in vector identifiers "x "y" and "z". Like all POV- Ray
- keywords they must be lower case. The vector identifier x is equivalent to
- the vector <1,0,0>. Similarly y is <0,1,0> and z is <0,0,1>. Thus an ex-
- pression like 5*x evaluates to 5*<1,0,0> or <5,0,0>. The use of these iden-
- tifiers can make the scene file easier to read.
-