4元素矢量(3D数学) [英] 4 Element Vector (3D Math)

查看:183
本文介绍了4元素矢量(3D数学)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么会出现在很多3D API的Vector类的在W期限(即的Vector4(X,Y,Z,W))?是否有数学运算是绝对需要在W期限?

Why is there a W term in a lot of 3D API's Vector class (i.e. Vector4(x, y, z, w) ) ? Are there math operations that absolutely require the W term?

推荐答案

这是在三维空间中,所谓的齐次坐标点的特殊重presentation 的。

This is a special representation of a point in 3D space, called homogeneous coordinates.

它们只是另一种方式来描述在三维空间中的点。它们都采用了大量的3D图形,因为他们有几个好处:他们做一些简单的公式,他们让你重新present一个无穷远点(或视维等。在无穷远处线)

They are just another way to describe a point in 3D space. They are used a lot in 3D graphics because they have a few advantages: they make some formulas simpler, and they allow you to represent a "point at infinity" (or "line at infinity" etc. depending on dimension).

请参阅例如这篇文章中的解释:

See e.g. this article for an explanation:

<一个href="http://andrewharvey4.word$p$pss.com/2008/09/29/xyzw-in-opengldirect3d-homogeneous-coordinates/">http://andrewharvey4.word$p$pss.com/2008/09/29/xyzw-in-opengldirect3d-homogeneous-coordinates/

维基百科也给出了一个很好的概述(警告,一些有趣而严肃的数学在那里):

Wikipedia also gives a nice overview (warning, some fun but serious math in there):

<一个href="http://en.wikipedia.org/wiki/Homogeneous_coordinates">http://en.wikipedia.org/wiki/Homogeneous_coordinates

<一个href="http://en.wikipedia.org/wiki/Projective_geometry">http://en.wikipedia.org/wiki/Projective_geometry

(射影几何的基本理论的齐次坐标)

(projective geometry is the underlying theory for homogeneous coordinates)

奖金的事实:

原因的对象,从我们熟悉的三维空间的转换实际上是更容易使用齐次坐标是因为,与直觉相​​反,射影几何避免了,你需要在欧几里得几何学的特例。有关详细信息,请参阅文章上面,或者在射影几何任何像样的数学书: - )

The reason that transformations of objects from our familiar 3D space are actually easier using homogeneous coordinates is because, contrary to intuition, projective geometry avoids some of the special cases that you need in Euclidean geometry. For details, see articles above, or any decent math book on projective geometry :-).

这篇关于4元素矢量(3D数学)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆