F[x_, y_, z_]:= Block[{u, v, θ, R},
u = {1,0, 0};
v ={x,y,z}/Sqrt[x^2+y^2+ z^2];
θ = N[ArcCos[(u.v)/(u.u)/(v.v)]];
R = {{Cos[θ] + u[[1]]^2 * (1- Cos[θ]), u[[1]]*u[[2]]*(1-Cos[θ]) - u[[3]]*Sin[θ], u[[2]]*u[[1]]*(1-Cos[θ]) + u[[2]]*Sin[θ] },{u[[2]]*u[[1]]*(1-Cos[θ]) + u[[3]]*Sin[θ], Cos[θ] +u[[2]]^2 *(1- Cos[θ]), u[[2]]*u[[3]]*(1-Cos[θ])- u[[1]]*Sin[θ]},
{u[[3]]*u[[1]]*(1-Cos[θ]) - u[[2]]*Sin[θ], u[[3]]*u[[2]]*(1-Cos[θ]) + u[[1]]*Sin[θ], Cos[θ]+u[[3]]^2 *(1-Cos[θ])}}
]

F[1,1,1]//MatrixForm

P[v_, C_, K_]:= Block[{P, R, I},
R = Take[RotationTransform[{{1,0,0},v}][[1]],{1,3},{1,3}];
I = IdentityMatrix[3];
P = N[K. R.Join[I,Transpose[{-C}],2]]
]

P[{1,1,1}, {0, 0, 0}, {{1,0,0},{0,1,0},{0,0,1}}]//MatrixForm

Manipulate[Graphics3D[GeometricTransformation[Cuboid[{2
2,2,1}],RotationTransform[{{1,0,0},{x,y,z}}]], PlotRange->{{-10,10},{-10,10},{-10,10}}, AxesLabel->{"x", "y","z"}],{x, -3,3,0.1}, {y,-3,3,0.1},{z,-3,3, 0.1}]

q = {{10, 10, 10}, {10, 20, 10}, {20, 20, 10}, {20, 10, 10},{10, 10, 20}, {10, 20, 20}, {20, 20, 20}, {20, 10, 20} };
ListPointPlot3D[q, PlotRange->{{0, 30},{0,30},{0,30}}]

t =P[{1,1,1}, {2, 2, 2}, {{2,0,0},{0,2,0},{0,0,1}}];
MatrixForm[t]

p = Table[t.Transpose[{Join[q[[k]], {1}]}], {k,8}]

Transpose[{Join[q[[1]], {1}]}]//MatrixForm

q1 = Transpose[Join[q, {{1},{1},{1},{1},{1},{1},{1},{1}},2]]

MatrixForm[q1]

q2 = t .q1

q3 = Transpose[q2]

q4 = Table[q3[[k]]/q3[[k,3]], {k,8}]

ListPointPlot3D[{q,q4}]

Angle