没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论









1
Projection and View Frustums
David E. Johnson
I. INTRODUCTION
In mathematics, a projection reduces an N-dimensional vector space R
N
to a subspace W. This subspace is likely
lower-dimensional than the original space. For example, a shadow is a projection of 3-space onto a 2D manifold.
A projection matrix is an N × N square matrix that defines the projection, although other projection operators are
valid. An example is the dot product of a vector with a unit vector u
proj
u
l = (l · u)u
which returns a vector on u with a length of l in the u direction. All these projections are linear transformations.
Thinking of the shadow example, straight lines connect all points on the 3D object to the projected shadow. Since
it is a linear transformation, the dot product can be encoded as a matrix as well.
u
x
u
x
u
y
u
x
u
x
u
y
u
y
u
y
l
x
l
y
=
(u
x
l
x
+ u
y
l
y
)u
x
(u
x
l
x
+ u
y
l
y
)u
y
= (l · u)u.
A projection matrix P has the property that
P
2
= P .
This makes intuitive sense since once the dimensionality of the original object has been reduced, projecting it
again leaves it the same. Take this example, where P is
P =
1 0 0
0 1 0
0 0 0
.
This projection takes an object from a 3D (x, y, z) space to a 2D (x, y) space. Performing matrix multiplication
P
2
=
1 0 0
0 1 0
0 0 0
1 0 0
0 1 0
0 0 0
=
1 0 0
0 1 0
0 0 0
= P ,
so its projection property is verified.
Makers of maps, illustrators, architects, and engineers have developed conventions for a number of projections.
Computer graphics regularly uses just a few of them. The proir example projection from 3D to a 2D is a basic
operation in computer graphics, where a 3D virtual world must be mapped to the 2D screen. In virtual reality, an
application developer must sometimes use projections that are non-standard for typical graphics programs.
A. Orthogonal Projections
An orthogonal projection takes points in space onto a viewing plane where all the motions of the points are
orthgonal, or normal, to the viewing plane. The previous example transformation is an example of an orthogonal
projection. Figure 1 shows a orthogonal projection of a virtual object onto the viewing plane. The box surrounding
the viewing plane and virtual space represents the viewing frustum or view frustum. The view frustum represents the
region of space that is projected onto the viewing plane. It defines the field of view of the virtual camera defining
the projection.
In OpenGL, the view frustum shape is set on the GL_PROJECTION stack and the glOrtho command creates
orthogonal projections.
glMatrixMode(GL_PROJECTION);
glOrtho( left, right, bottom, top, near, far);
资源评论


trickeryoung
- 粉丝: 0
- 资源: 7
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


安全验证
文档复制为VIP权益,开通VIP直接复制
