home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 2555 / povhlp / vector.hlp < prev    next >
Encoding:
Text File  |  1994-07-04  |  2.1 KB  |  36 lines

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