Reading a book - "Introduction to 3D Game Programming with Directx12 by Frank Luna", I did not understand how we got the rotation matrix from function
the rotation matrix is:
to get this matrix from this rule:
CodePudding user response:
Very nice formula.
Assuming |n|=1
, the term (n.v)n
is the projection of v
in the direction of n
, that must be unchanged.
The term v - (n.v)n
is the projection of v
in the plane normal to n
, thus multiplied by cos(theta)
.
The term n x v
is the vector normal to the plane containing n
and v
, thus multiplied by sin(theta)
.
CodePudding user response:
I found that cross product and projection can be represented as matrices