本文整理汇总了C++中Quaternion::CreateFromEuler方法的典型用法代码示例。如果您正苦于以下问题:C++ Quaternion::CreateFromEuler方法的具体用法?C++ Quaternion::CreateFromEuler怎么用?C++ Quaternion::CreateFromEuler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quaternion
的用法示例。
在下文中一共展示了Quaternion::CreateFromEuler方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
Matrix mat1, mat2, mat3, mat4;
mat1.Create(3, 5);
mat2.Create(5, 3);
mat3.Create(4, 4);
mat4.Create(4, 4);
for(unsigned int i = 0; i < mat2.Rows(); i++)
for(unsigned int j = 0; j < mat2.Cols(); j++)
mat2[i][j] = (i + j);
for(unsigned int i = 0; i < mat1.Rows(); i++)
for(unsigned int j = 0; j < mat1.Cols(); j++)
mat1(i, j) = (i + j);
mat3[0][0] = 3; mat3[0][1] = 2; mat3[0][2] = 0; mat3[0][3] = 1;
mat3[1][0] = 4; mat3[1][1] = 0; mat3[1][2] = 1; mat3[1][3] = 2;
mat3[2][0] = 3; mat3[2][1] = 0; mat3[2][2] = 2; mat3[2][3] = 1;
mat3[3][0] = 9; mat3[3][1] = 2; mat3[3][2] = 3; mat3[3][3] = 1;
mat1.Print();
//mat1.Transpose().Print();
mat2.Print();
mat3.Print();
cout << "M1 * M2 = \n";
mat1 *= mat2;
mat1.Print();
double d;
mat3.GetDeterminant(d);
cout << "Det of M3 = " << d << "\n";
mat4[0][0] = 1; mat4[0][1] = 0; mat4[0][2] = 0; mat4[0][3] = 0;
mat4[1][0] = 0; mat4[1][1] = 1; mat4[1][2] = 0; mat4[1][3] = 0;
mat4[2][0] = 0; mat4[2][1] = 0; mat4[2][2] = 1; mat4[2][3] = 0;
mat4[3][0] = 0; mat4[3][1] = 0; mat4[3][2] = 0; mat4[3][3] = 1;
Matrix imat3;
Matrix::GaussJordan(mat3, mat4, imat3);
cout << "Matrix A:\n";
mat3.Print();
cout << "Inverse of Matrix A:\n";
imat3.Print();
cout << "A*A^-1\n";
(mat3*imat3).Print();
cout << "Checking inverse\n";
Matrix iden = mat3.Inverse()*mat3;
iden.Print();
Vector3D vector;
Quaternion q;
vector.mX = 1;
double theta, pitch;
theta = -30;
pitch = -20;
q.CreateFromEuler(theta, pitch, theta, true);
vector = q.Rotate(vector);
vector.Print();
Quaternion a1, a2;
a1.CreateFromEuler(0, 0, 30, true);
a2.CreateFromEuler(0, 0, 90, true);
a1 = a1 - a2;
a1.Print(true, true);
return 0;
}