且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用四元数绕轴旋转矢量

更新时间:2023-02-02 17:19:37

基本上是沿 x 轴 (1,0,0) 旋转一个向量,角度为 90 度,使用下面的方法,这对 Euler 和四元数都有效>

Basically to rotate an vector along x axis (1,0,0) with angle 90 deg, use below method, this works for both Euler and quaternion

| 1    0           0 |   | 0 |     | 0 |
| 0   cos90   -sin90 | * | 1 |  =  | 0 |
| 0   sin90    cos90 |   | 0 |     | 1 |

阅读关于旋转矩阵http://en.wikipedia.org/wiki/Rotation_matrix