| Linderdaum Engine: LTransform.cpp File Reference | ![]() |
Transformation. More...
Functions | |
| LMatrix4 | ComposeTransformation (const LVector3 &Pos, const LMatrix4 &Rot) |
| LMatrix4 | ComposeCameraTransformation (const LVector3 &Pos, const LMatrix4 &Rot) |
| void | DecomposeTransformation (const LMatrix4 &T, LVector3 &Pos, LMatrix4 &Rot) |
| void | DecomposeCameraTransformation (const LMatrix4 &T, LVector3 &Pos, LMatrix4 &Rot) |
| void | GivensRotation (float a, float b, float &c, float &s, float &r) |
| void | MatrixToAngles (LEulerAngleSystem Sys, const LMatrix3 &M, float &T1, float &T2, float &T3) |
| void | MakeRotationMatrix (LMatrix4 &R, int axis, float angle) |
| void | AnglesToMatrix (LEulerAngleSystem Sys, LMatrix4 &M, float T1, float T2, float T3) |
Variables | |
| int | EulerAxes [12][3] |
| indices of the axes fora given coordinate system | |
| LVector3 | EuclideanBasis [3] = { vec3( 1, 0, 0 ), vec3( 0, 1, 0 ), vec3( 0, 0, 1 ) } |
Transformation.
| void AnglesToMatrix | ( | LEulerAngleSystem | Sys, |
| LMatrix4 & | M, | ||
| float | T1, | ||
| float | T2, | ||
| float | T3 | ||
| ) |
Calculate orientation from three Euler angles in a given axis system (ZXZ etc.)
Find a planar rotation (c=cos, s=sin) which maps (a,b) vector to (r,0)
http://www.cgafaq.info/wiki/Euler_angles_from_matrix
The following method, choosing either t=cot(theta) or t=tan(theta) as route, is a variation of that recommended by Golub and Van Loan, made continuous as suggested by Edward Anderson
| void MatrixToAngles | ( | LEulerAngleSystem | Sys, |
| const LMatrix3 & | M, | ||
| float & | T1, | ||
| float & | T2, | ||
| float & | T3 | ||
| ) |
Calculate three Euler angles from orientation in a given axis system (ZXZ etc.)
[T1,T2,T3] -> [T3,T2,T1]
| LVector3 EuclideanBasis[3] = { vec3( 1, 0, 0 ), vec3( 0, 1, 0 ), vec3( 0, 0, 1 ) } |