Suppose I have an arbitrary independent vector B that is $[0, 0, 1]^T$ and a position vector P $[P_x, P_y, P_z]$. I want to create a rotation matrix from this. Some sources say to get a rotation matrix you have to $W = P ÷ ||P||$ from this you get $ V = (W*B) ÷ ||(W*B)|| $, and $ U = W*V $ so the rotation matrix is $$R = \begin{bmatrix}
U_x & V_x & W_x \\
U_y & V_y & W_y \\
U_z & V_z & W_z \\ \end{bmatrix}$$
Is this the correct rotation matrix and I don't know how to compute B. Can you explain it to me in detail.
Tanks!