小编use*_*068的帖子

将 glm 四元数转换为旋转矩阵并将其与 opengl 一起使用

所以我将对象的方向存储在 glm::fquat 中,我想用它来旋转我的模型。我怎么做?

我试过这个:

glPushMatrix();
   glTranslatef(position.x, position.y, position.z);
   glMultMatrixf(glm::mat4_cast(orientation));
   glCallList(modelID);
glPopMatrix();
Run Code Online (Sandbox Code Playgroud)

但我收到了这个错误:

error: cannot convert 'glm::detail::tmat4x4<float>' to 'const GLfloat* {aka const float*}' for argument '1' to 'void glMultMatrixf(const GLfloat*)'|
Run Code Online (Sandbox Code Playgroud)

我显然做错了什么,那么正确的方法是什么?

c++ opengl matrix quaternions glm-math

5
推荐指数
1
解决办法
5058
查看次数

标签 统计

c++ ×1

glm-math ×1

matrix ×1

opengl ×1

quaternions ×1