3D vertices $\rightarrow$ 2D polygon $\rightarrow$ 3d transformation

149 Views Asked by At

This may be a little strange.

I have an array of 3D vertices, which represent a 3D face (n-gon). I first need to describe the face in 2D. I can then apply these transforms on it.

  • X, Y, and Z rotation
  • X, Y, and Z positions

I'm looking for some pointers on what topics I should read up on do understand how to implement this in code.

Phrases I can type into Google, algorithms, and explanations are all appreciated.


So far I've come up with taking three points, $p,q,s$ where $q$ is connected to $p$ and $s$, and doing the following

$\vec{a} = q - p$
$\vec{b} = q - s$
$c = b \times \vec{{(0, 0, 0)}}$

To my understanding, that means that $c$ will hold the normal of $a$ and $b$. Is this correct?

For example, the points $p,q,s$ are $[-1,0,-1];[-1,2,-1];[1,2,1]$, which results in $c$ being $[-4,0,4]$.

How do I take the normal vector and use it to move points from that plane to the XY plane?