正交投影矩阵的公式?

发布于 2024-07-15 19:05:56 字数 123 浏览 6 评论 0 原文

我环顾四周,似乎找不到我正在寻找的东西。我找到了“规范公式”,但是使用这些公式的最佳方法是什么?我是否必须缩小每个顶点或者有更好的方法吗?

一个公式确实可以帮助我,但我也在寻找有关观察者位置的近Z平面和远Z平面的解释

I've been looking around a bit and can't seem to find just what I"m looking for. I've found "canonical formulas," but what's the best way to use these? Do I have to scale every single vertex down? Or is there a better way?

A formula would really help me out, but I'm also looking for an explanation about the near and far z planes relative the viewer's position

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

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

发布评论

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

评论(2

北方的巷 2024-07-22 19:05:56

这是一个合理的来源,派生出正交项目矩阵

考虑几点:第一,在眼睛上
空间,您的相机位于
原点并直接向下看
z 轴。 其次,你通常
希望你的视野扩大
与向左同样远
右边,并且同样远高于
z 轴如下。 如果是这样的话,
z轴直接穿过
你的视野中心,所以你
有 r = –l 且 t = –b。 其他
单词,你可以忘记r,l,t,
和 b 一起,并简单地定义
以宽度表示的视图体积
w 和高度 h,以及您的
其他剪裁平面 f 和 n。 如果你
将这些替换成
上面的正交投影矩阵,
你会得到这个相当简单的结果
版本:

以上所有内容都为您提供了一个看起来像这样的矩阵(如果您希望生成的转换矩阵处理任意相机位置和方向,请酌情添加旋转和平移)。

A LaTeX正交投影矩阵的渲染
(来源:codeguru.com

Here is a reasonable source that derives an orthogonal project matrix:

Consider a few points: First, in eye
space, your camera is positioned at
the origin and looking directly down
the z-axis. And second, you usually
want your field of view to extend
equally far to the left as it does to
the right, and equally far above the
z-axis as below. If that is the case,
the z-axis passes directly through the
center of your view volume, and so you
have r = –l and t = –b. In other
words, you can forget about r, l, t,
and b altogether, and simply define
your view volume in terms of a width
w, and a height h, along with your
other clipping planes f and n. If you
make those substitutions into the
orthographic projection matrix above,
you get this rather simplified
version:

All of the above gives you a matrix that looks like this (add rotation and translation as appropriate if you'd like your resulting transformation matrix to treat an arbitrary camera position and orientation).

A LaTeX rendering of the orthographic projection matrix
(source: codeguru.com)

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