next up previous
Next: 5 Differences Between Computer Up: 4 Surface Normal Vector Previous: 4.1 Vector treatment

4.2 Scalar treatment

Combining Equations 1, 2 and 3, we obtain Equation 5.

\begin{displaymath}
\mathbf{n}=\left( \mathbf{P}_{3}-\mathbf{P}_{2}\right) \times \left( \mathbf{P}_{2}-\mathbf{P}_{1}\right)
\end{displaymath} (5)

Expanding this into the individual components, and using the definition of vector cross-product, we obtain the three Equations 6 to 8.

$\displaystyle n_{x}$ $\textstyle =$ $\displaystyle \left( P_{3y}-P_{2y}\right) \left( P_{2z}-P_{1z}\right) -\left( P_{3z}-P_{2z}\right) \left( P_{2y}-P_{1y}\right)$ (6)
$\displaystyle n_{y}$ $\textstyle =$ $\displaystyle \left( P_{3z}-P_{2z}\right) \left( P_{2x}-P_{1x}\right) -\left( P_{3x}-P_{2x}\right) \left( P_{2z}-P_{1z}\right)$ (7)
$\displaystyle n_{z}$ $\textstyle =$ $\displaystyle \left( P_{3x}-P_{2x}\right) \left( P_{2y}-P_{1y}\right) -\left( P_{3y}-P_{2y}\right) \left( P_{2x}-P_{1x}\right)$ (8)

In order to normalise these values, we find the scalar value \( n \), using the values for \( n_{x} \), \( n_{y} \) and \( n_{z} \) found in Equations 6 to 8.

\begin{displaymath}
n=\left\vert \mathbf{n}\right\vert =\sqrt{n_{x}^{2}+n_{y}^{2}+n_{z}^{2}}
\end{displaymath} (9)

We now use this normalisation factor to find the normalised versions of Equations 6 to 8.


$\displaystyle \hat{n}_{x}$ $\textstyle =$ $\displaystyle \frac{1}{n}n_{x}$  
  $\textstyle =$ $\displaystyle \frac{1}{n}\left( P_{3y}-P_{2y}\right) \left( P_{2z}-P_{1z}\right) -\frac{1}{n}\left( P_{3z}-P_{2z}\right) \left( P_{2y}-P_{1y}\right)$ (10)
$\displaystyle \hat{n}_{y}$ $\textstyle =$ $\displaystyle \frac{1}{n}n_{y}$  
  $\textstyle =$ $\displaystyle \frac{1}{n}\left( P_{3z}-P_{2z}\right) \left( P_{2x}-P_{1x}\right) -\frac{1}{n}\left( P_{3x}-P_{2x}\right) \left( P_{2z}-P_{1z}\right)$ (11)
$\displaystyle \hat{n}_{z}$ $\textstyle =$ $\displaystyle \frac{1}{n}n_{z}$  
  $\textstyle =$ $\displaystyle \frac{1}{n}\left( P_{3x}-P_{2x}\right) \left( P_{2y}-P_{1y}\right) -\frac{1}{n}\left( P_{3y}-P_{2y}\right) \left( P_{2x}-P_{1x}\right)$ (12)

The values \( \hat{n}_{x} \), \( \hat{n}_{y} \) and \( \hat{n}_{z} \) given in Equations 10 to 12 are now the \( x \), \( y \) and \( z \) coordinates of the normalised surface normal to the triangle with vertices \( \mathbf{P}_{1}=\left( P_{1x},P_{1y},P_{1z}\right) \), \( \mathbf{P}_{2}=\left( P_{2x},P_{2y},P_{2z}\right) \) and \( \mathbf{P}_{3}=\left( P_{3x},P_{3y},P_{3z}\right) \).


next up previous
Next: 5 Differences Between Computer Up: 4 Surface Normal Vector Previous: 4.1 Vector treatment
Kevin Pulo
2000-08-22