好吧,我已经确信四元数是"未来之路",而不是试图让俯仰,偏航,滚动旋转工作.所以现在我的代码看起来像这样(obj-C,但它应该没关系):
[quaternion makeIdentity];
[quaternion setPitch: rotation.x yaw: rotation.y roll: rotation.z];
GLfloat matrix[16];
[quaternion stuffMatrix: &matrix];
matrix[12] = location.x;
matrix[13] = location.y;
matrix[14] = location.z;
// Now what?
// glSetMatrix(matrix); // No, that's not right, is it?!
Run Code Online (Sandbox Code Playgroud)
一旦我设置了四元数以处理各种旋转并将值填充到矩阵数组中,如何将当前矩阵设置为这些值?
谢谢!
PS是的,我是Open-GL n00b.对不起,如果这是基本的东西; 我似乎无法在文档中找到它.