0
$\begingroup$

Hi I have the following co-ordinates, which make up my triangle based pyramid. I need to calculate the normals of each face. However Im struggling to find the best simplest way to do this?

-0.5, 0, 0.5,  0, 0, -0.5, 0.5, 0, 0.5,  0, 0, -0.5, 0.5, 0, 0.5, 0, 1, 0,  -0.5, 0, 0.5, 0, 0, -0.5, 0, 1, 0,  0.5, 0, 0.5, -0.5, 0, 0.5, 0, 1, 0 

enter image description here

  • 0
    Look up Newell's algorithm.2012-08-13

1 Answers 1

1

Given three non aligned point of a face, say $A, B, C$, build the vectors $ \mathbf{u}=B-A,\\ \mathbf{v}=C-A. $ The vector $\mathbf{n}=\mathbf{u}\times\mathbf{v}$ is normal to the given face, you should only normalize its length.


Take $ A=(-1/2, 0, 1/2),\\ B=(0, 0, -1/2),\\ C=(1/2, 0, 1/2), $ then build $ \mathbf{u}=B-A=( 0, 0, -1/2)-(-1/2, 0, 1/2)=(1/2,0,-1),\\ \mathbf{v}=C-A=(1/2, 0, 1/2)-(-1/2, 0, 1/2)=(1,0,0). $ and $ \mathbf{n}=\mathbf{u}\times\mathbf{v}=\left| \begin{matrix} i &j &k\\ 1/2 &0 &-1\\ 1 &0 &0 \end{matrix} \right|=(0,-1,0) $ The resulting vector is, in this particular case, already normalized.

  • 1
    For consistency, one would want to ensure that the vertices of the polygons are all "clockwise" or "anticlockwise" before computing the normals, lest one obtain a result where some of the normals are pointing "outside" the pyramid, and the others are pointing "inside".2012-08-14