4.1 Affine space

The objects we want to display are situated in the space surrounding us. We will neglect that this space is curved by gravitation according to Einsteins general relativity theory (or 26 dimensional according to some quantum theoretic approaches) and for sake of simplicity we may assume that this is an affine 3-dimensional space. So after choosing some reference frame, i.e. a zero-point and three independent vectors we may identify this space with the standard 3-dimensional vector space $ \protect\mathbb{R}^3$. Its points are uniquely given by 3 real coordinates $ (a,b,c)$ denoted by $ \langle a,b,c\rangle$ in Pov-Ray. In Pov-Ray one may use as shortcut for a vector with equal coordinates the real number given by this coordinate, e.g. $ 0=\langle 0,0,0\rangle$. The standard basis with respect to the given frame is denoted

$\displaystyle x:=\langle 1,0,0\rangle, \qquad
y:=\langle 0,1,0\rangle, \qquad
z:=\langle 0,0,1\rangle
$

in Pov-Ray, and are interpreted as pointing right, up and forward. This is a let-handed system, i.e. take your left hand, let the thumb point in direction $ x$ and the index finger point in direction $ y$, then the middle finger points in direction $ z$.

Figure: Pov-Ray's left-handed coordinate system
Image /home/andreas/tex/Books/computer-graphics/img//left-handed.png

Note that the second basic vector $ y$ and not $ z$ is pointing up. The idea behind this choice ist that usually we will project onto some vertical plane, so the first two coordinates should be associated to this plane.

On $ \protect\mathbb{R}^3$ we have the usual vector operations:

$\displaystyle \lambda \cdot \langle a_1,b_1,c_1\rangle$ $\displaystyle = \langle \lambda \cdot a_1,\lambda \cdot b_1,\lambda \cdot c_1\rangle$   addition    
$\displaystyle \langle a_1,b_1,c_1\rangle + \langle a_2,b_2,c_2\rangle$ $\displaystyle = \langle a_1+a_2,b_1+b_2,c_1+c_2\rangle$   addition    

Figure: Scalar multiplication and vector addition
Image /home/andreas/tex/Books/computer-graphics/img//v-scale.png      Image /home/andreas/tex/Books/computer-graphics/img//v-add.png

We will also make use of the inner product $ \langle v\vert w\rangle$ (denoted $ \operatorname{vdot}(v,w)$ in Pov-Ray) of two vector $ v$ and $ w$, measuring essentially the angle $ \angle(v,w)$ between the two vectors via

$\displaystyle \cos(\angle(v,w))=\frac{\operatorname{vdot}(v,w)}{\sqrt{\operatorname{vdot}(v,v)}\sqrt{\operatorname{vdot}(w,w)}}
$

and the length

$\displaystyle \operatorname{vlength}(v):=\Vert v\Vert:=\sqrt{\operatorname{vdot}(v,v)}.
$

Thus $ \operatorname{vdot}(v,w)$ is the length of $ v$ multiplied with the length of the normal projection of $ w$ onto $ v$. Using the length we may normalize any vector $ v\ne 0$ to obtain a vector of length 1 pointing in the same direction as $ v$:

$\displaystyle \operatorname{vnormalize}(v):=\frac1{\operatorname{vlength}(v)}\,v.
$

Furthermore we have the cross-product (denoted $ \operatorname{vcross}(v,w)$ in Pov-Ray) of two vectors, which gives a vector normal to $ v$ and $ w$ of length the area of the parallelogram generated by $ v$ and $ w$ and such that $ v,w,\operatorname{vcross}(v,w)$ is positively oriented. So we have an euclidean space.

Andreas Kriegl 2003-07-23