gpt4 book ai didi

math - OpenGL 矩阵 VS DirectX 矩阵

转载 作者:行者123 更新时间:2023-12-04 23:25:32 27 4
gpt4 key购买 nike

我只处理过 DirectX 矩阵

我读过一些文章,说不能将 DirectX 矩阵数学库用于 openGL 矩阵。

但我也读过,如果你的数学是一致的,你可以获得类似的结果。那只会让我更加困惑。

任何人都可以启发我吗?或者如果您不能在 openGL 矩阵上使用 DirectX 数学。有谁知道一个好的openGL矩阵库?

任何有助于理解他们的差异和数学知识的帮助将不胜感激。

最佳答案

I have read articles that say you cannot use DirectX matrix math libraries for openGL matrices.



这是错误的。

but i have also read that if your math is consistent you can get similar to same results.



唯一的区别在于 OpenGL 和 DirectX 对其规范化设备坐标空间的默认假设。他们使用略有不同的范围和符号。然而,这只会转化为一个转换堆栈,并在其上预乘了一个额外的“适配器”矩阵,您就完成了。

同样重要的可能是索引顺序,但现代 OpenGL 允许您选择名称为“转置”的 glUniformMatrix 参数使用的顺序

关于math - OpenGL 矩阵 VS DirectX 矩阵,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13318431/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com