#include <iostream>
#include<glm/glm.hpp>
#include<glm/gtc/quaternion.hpp>
#include<glm/common.hpp>
using namespace std;
int main()
{
glm::mat4 MyMatrix=glm::mat4();
glm::quat myQuat;
myQuat=glm::quat(0.707107,0.707107,0.00,0.000);
glm::mat4 RotationMatrix = glm::mat4_cast(myQuat);
for(int i=0;i<4;++i)
{
for(int j=0;j<4;++j)
{
cout<<RotationMatrix[i][j]<<" ";
}
cout<<"\n";
}
return 0;
}
//http://people.inf.elte.hu/stbqaai/szGraf/GL/glm-0.9.B.1/doc/html/namespacemembers.html(glm文档拿走不谢);
opengl 中的 gml 函数库四元素转为旋转矩阵(亲测可用)
最新推荐文章于 2023-09-24 14:35:39 发布