现在的位置: 首页 > 综合 > 正文

homogeneous clip coordinates

2018年05月27日 ⁄ 综合 ⁄ 共 1068字 ⁄ 字号 评论关闭

Points within the perspective (or orthographic) frustum are transformed by the projection
matrix to the (homogeneous) space that is contained within a cube centered
at the origin, with side length of 2. This space is called the canonical
viewing volume. The term "homogeneous" means that these coordinates
should not necessarily be considered to be true Cartesian positions until they

are divided by their fourth coordinate.

The x and y components of the position in clip coordinates are roughly what we need to
access the shadow map. The z coordinate contains the depth information that we can use to
compare with the shadow map. However, before we can use these values we need to do two
things. First, we need to bias them so that they range from zero to one (instead of -1 to 1), and
second, we need to apply perspective division (more on this later).

In clip coordinates (after perspective division) the z coordinate ranges from
-1 to 1. It is the viewport transformation that (among other things) converts
the depth to a range between zero and one. Incidentally, if so desired, we can
configure the viewport transformation to use some other range for the depth
values (say between 0 and 100) via the function glDepthRange.

简单来说就是经过透视变化后各个坐标除以w,在(-1,-1,-1)到(1,1,1)的Cube里。

抱歉!评论已关闭.