我想将gmm中的四元数转换为mat4。使用glm的四元数到矩阵
我的代码是:
#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 = quaternion::toMat4(myQuat);
for(int i=0;i<4;++i)
{
for(int j=0;j<4;++j)
{
cout<<RotationMatrix[i][j]<<" ";
}
cout<<"\n";
}
return 0;
}
当我运行程序它显示的错误“错误:‘四元数’尚未声明”。
任何人都可以帮助我吗?
是否'四元数:: toMat4'必须'GLM ::四元:: toMat4'? – NathanOliver