三维投影:修订间差异
←建立内容为“{{translating|en:3D_projection||tpercent=5|time=2009-12-22T03:39:46}} <!-- Please Read Discussion Page before reinserting image --> '''三维投...”的新页面 |
(没有差异)
|
2009年12月23日 (三) 03:12的版本
此條目目前正依照en:3D_projection上的内容进行翻译。 (2009年12月22日) |
三维投影是将三维空间中的点映射到二维平面上的方法。由于目前绝大多数图形数据的显示方式仍是二维的,因此三维投影的应用相当广泛,尤其是在计算机图形学,工程学和en:drafting中。
正交投影
建議此條目或章節與正交投影合并。(討論) |
正交投影是一系列用于显示三维物体的轮廓、细节或精确测量结果的变换方法。通常又被称作plan、截面图、鸟瞰图或立面图。
当视平面的法向(即摄像机的朝向)平行于笛卡尔坐标系三根坐标轴中的一根,数学变换定义如下: 若使用一个平行于y轴(侧视图)的正交投影将三维点, , 投影到二维平面上得到二维点, ,可以使用如下公式
其中向量s是一个任意的缩放因子,而c是一个任意的偏移量。这些常量可自由选自,通常用于将视口调整到一个合适的位置。该投影变换同样可以使用矩阵表示(为清晰起见引入临时向量d)
虽然正交投影产生的图像在一定程度上反映了物体的三维特性,但此类投影图像和实际观测到的并不相同。特别是对于相同长度的平行线段,无论离虚拟观察者(摄像机)远近与否,它们都会在正交投影中显示为相同长度。这会导致较近的线段看起来被缩短了。
透视投影
建議此條目或章節與透视合并。(討論) |
- See also 变换矩阵
The perspective projection requires greater definition. A conceptual aid to understanding the mechanics of this projection involves treating the 2D projection as being viewed through a camera viewfinder. The camera's position, orientation, and field of view control the behavior of the projection transformation. The following variables are defined to describe this transformation:
- - the point in 3D space that is to be projected.
- - the location of the camera.
- - The rotation of the camera. When =<0,0,0>, and =<0,0,0>, the 3D vector <1,2,0> is projected to the 2D vector <1,2>.
- - the viewer's position relative to the display surface. [1]
Which results in:
- - the 2D projection of .
First, we define a point as a translation of point into a coordinate system defined by . This is achieved by subtracting from and then applying a vector rotation matrix using to the result. This transformation is often called a camera transform (note that these calculations assume a left-handed system of axes): [2] [3]
Or, for those less comfortable with matrix multiplication. Signs of angles are inconsistent with matrix form:
This transformed point can then be projected onto the 2D plane using the formula (here, x/y is used as the projection plane, literature also may use x/z):[4]
Or, in matrix form using homogeneous coordinates:
and
The distance of the viewer from the display surface, , directly relates to the field of view, where is the viewed angle. (Note: This assumes that you map the points (-1,-1) and (1,1) to the corners of your viewing surface)
Subsequent clipping and scaling operations may be necessary to map the 2D plane onto any particular display media.
图示
File:Perspective Transform Diagram.png
To determine which screen x coordinate corresponds to a point at Ax,Az multiply the point coordinates by:
the same works for the screen y coordinate:
(where Ax and Ay are coordinates occupied by the object before the perspective transform)
参看
参考文献
- ^ Ingrid Carlbom, Joseph Paciorek, Planar Geometric Projections and Viewing Transformations, ACM Computing Surveys, 1978, 10 (4): 465–502, doi:10.1145/356744.356750.
- ^ Riley, K F. Mathematical Methods for Physics and Engineering. Cambridge University Press. 2006: 931,942. ISBN 0521679710. doi:10.2277/0521679710.
- ^ Goldstein, Herbert. Classical Mechanics 2nd Edn.. Reading, Mass.: Addison-Wesley Pub. Co. 1980: 146–148. ISBN 0201029189.
- ^ Sonka, M; Hlavac, V; Boyle, R, Image Processing, Analysis & Machine Vision 2nd Edn., Chapman and Hall: 14, 1995, ISBN 0412455706
深入阅读
- Kenneth C. Finney. 3D Game Programming All in One. Thomson Course. 2004: 93. ISBN 159200136X.