3D rotation of vectors lying on a triangular plane

258 Views Asked by At

I would like to rotate vectors lying on the plane of a triangle in 2D into a 3D triangle with the same side length.

2D triangle defined by three points: $$ a=\begin{bmatrix}0 \\ 0 \\\end{bmatrix}, b=\begin{bmatrix}1.4142 \\ 0 \\\end{bmatrix}, c=\begin{bmatrix}0 \\ 1.7321 \\\end{bmatrix} $$ 3D triangle defined by three points: $$ a=\begin{bmatrix}0 \\ 1 \\ 2 \\\end{bmatrix}, b=\begin{bmatrix}0 \\ 0 \\1\\\end{bmatrix}, c=\begin{bmatrix}1 \\ 2 \\ 1 \\\end{bmatrix} $$ Surface normals are: $$ n2d=\begin{bmatrix}0 \\ 0 \\ 1 \\\end{bmatrix}, n3d=\begin{bmatrix}0.8165 \\ -0.4082 \\-0.4082\\\end{bmatrix} $$ Next I calculate theta and k for the rodrigues rotation: $$n2d_n = \frac{n2d}{|n2d|}, n3d_n = \frac{n3d}{|n3d|}$$

$$ k=\frac{n2d_n\times n3d_n }{ |n2d_n\times n3d_n|}\cdot-1 $$ $$ \theta=cos^{-1}(n2d_n\cdot n3d_n)$$

Applying the rotation on the surface normal of the 2D triangle gives me the 3D surface normal.

$$ n3d_n = n2d_n\cdot\cos\theta + (k\times n2d_n)\cdot\sin\theta + k\cdot(k\cdot n2d_n)\cdot(1-\cos \theta) $$

However if I apply the same formula on other vectors that lie on the plane of the 2D triangle, they are lying perfectly on the surface of the 3D triangle but they are rotated by some angle around the 3D surface normal.

How do I calculate this angle? Is there an easier way to achieve my goal?

Thanks!

2D triangle, vectors 3D triangle, vectors

1

There are 1 best solutions below

3
On BEST ANSWER

You are lucky that the initial vertices are on the axis, don't spoil that.

Subract $a$ from $b$ and $c$ to rotate around the origin (you will translate back after rotation). Then normalize $ab$ and $ac$ to unit length and compute $ad:=ab\times ac$.

Your linear transformation matrix is made of the column vectors $ab,ac,ad$.