DirectX Math 函数混乱

发布于 12-23 05:32 字数 187 浏览 4 评论 0原文

当我检查一些较旧的 DirectX 代码时,我发现了函数 D3DXVec3Transform 和 D3DXVec3TransformCoord。查了一下它们的描述,它们看起来很相似,但我不明白两者之间有什么区别。有人可以解释一下 D3DXVec3Transform 和 D3DXVec3TransformCoord 之间的区别是什么,以及它们背后的数学原理吗?

While I was going over some older DirectX code, I came by the functions D3DXVec3Transform and D3DXVec3TransformCoord. Upon looking up the descriptions for them, they seemed rather similar but I don't see what the difference between the two are. Can someone please explain what is the difference between D3DXVec3Transform and D3DXVec3TransformCoord are, along with the math behind them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傻比既视感2024-12-30 05:32:35

当您通过矩阵变换 3D 向量时,会产生 4D 向量,其中 w!=1

3D 向量可以描述为 4D 向量,其中 w=1。

D3DXVec3Transform 返回 4D 向量,其中 w!=1。
D3DXVec3TransformCoord 获取 4D 向量并将其投影到 w=1 上以使其成为 3D 向量。

编辑:如果对如何进行转换感兴趣,这是我在谷歌上搜索并发现的论文:
http://www.heldermann-verlag.de/jgg/jgg01_05/jgg0404.pdf

When you transform a 3D vector by matrix it results in a 4D vector where w!=1

a 3D vector can be described as 4D vector where w=1.

D3DXVec3Transform returns the 4D vector where w!=1.
D3DXVec3TransformCoord gets the 4D vector and the projects it onto w=1 to make it 3D vector.

EDIT: And here is the paper I google'd and found if interested in how to do the transformation:
http://www.heldermann-verlag.de/jgg/jgg01_05/jgg0404.pdf

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文