Collada 场景中发现的投影矩阵
我有一个关于当前投影矩阵的问题,我需要为在 opengl 中渲染的模型添加该矩阵。投影矩阵位于 collada 文件中,用于将组放置在与其他组(例如自行车车轮和自行车车身)不同的位置/旋转中。模型组的投影矩阵如下所示:
<matrix>
0.02081 0.01211 0.45265 -0.41217
-0.02644 0.0902 -0.04717 0.31703
-0.13606 -0.01567 0.07841 0.14996
0.0 0.0 0.0 1.0
</matrix>
我如何实现读取组的旋转和平移,以便在 opengl 中正确渲染整个模型,就像在使用的 CAD 软件中绘制的一样?如果有一种简单的方法(例如直接应用投影矩阵的预制库),请向我提供一个链接,或者更好的选择是了解如何实现和读取该矩阵的链接。请尽快回复并提前致谢。
I have a question concerning a current projection matrix that i need to add for a model rendered in opengl. The projection matrix is found in a collada file for placing a Group in a different location/rotation than other group such as wheels of a bike and the body of the bike. The projection matrix of a model group goes like this:
<matrix>
0.02081 0.01211 0.45265 -0.41217
-0.02644 0.0902 -0.04717 0.31703
-0.13606 -0.01567 0.07841 0.14996
0.0 0.0 0.0 1.0
</matrix>
How can i implement this for rotation and translation of the read group in order to render the whole model correctly in opengl as its drawn in the CAD software used? Please supply me with a link if there is an easy way to do it like a premade library that directly apply the projection matrix or the better option is a link to understand how to implement and read that matrix. Please reply as soon as possible and thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能不是整个投影,而只是模型视图矩阵。使用 glLoadMatrix 或 glMultMatrix 将其加载到 OpenGL<3,具体取决于矩阵是否存储在变换层次中。
This is probably not the whole projection, but just the modelview matrix. Load it into OpenGL<3 using glLoadMatrix or glMultMatrix, depending on, if the matrices are stored in a transformation heirachy.