PBRT_V2 总结记录 <15> Transform 和 Coordinate Spaces 和 Coordinate System Handedness

Transform 类

class Transform {
public:
Transform Public Methods
private:
Transform Private Data
};

类的作用:

(Transform 代表的就是一个矩阵,这个矩阵是 行为主的,也就是类似为OpenGL的矩阵计算方式)

A transformation is represented by the elements of the matrix m[4][4], a Matrix4x4
object. The low-level Matrix4x4 class is defined in Section A.6.2. m is stored in row-major
form, so element m[i][j] corresponds to mi , j, where i is the row number and j is the
column number.

 

 

Coordinate Spaces

1. Object space:

This is the coordinate system in which geometric primitives are defined.
For example, spheres in pbrt are defined to be centered at the origin of object
space.

 

2. World space:

While each primitive may have its own object space, all objects in the
scene are placed in relation to a single world space. Each primitive has an objectto-
world transformation that determines where it is located in world space. World
space is the standard frame that all spaces are defined in terms of.

 

3. Camera space:

(相机空间,坐标系的 +Z轴  就是 Camera 的 Forward)

A virtual camera is placed in the scene at some world space point
with a particular viewing direction and orientation. This defines a new coordinate
system with its origin at the camera’s location. The z axis of this coordinate system
is mapped to the viewing direction, and the y axis is mapped to the up direction.

This is a handy(便利) space for reasoning about which objects are potentially(可能) visible to the
camera. For example, if an object’s camera space bounding box is entirely behind the
z = 0 plane (and the camera doesn’t have a field of view wider than 180 degrees), the
object will not be visible to the camera.

 

4. Screen space:

(注意,这里的 "Screen space" 其实就是 并不是 平时理解的屏幕空间,其实可以理解为是类似OpenGL的裁剪空间,通过一个投影矩阵 ,从Camera space 变换到 Screen space, 但是有点不同的是,在这个Screen space 的时候, z 就变换到 [0,1] 之间,区别于OpenGL,OpenGL的Z值是变换到NDC中才是[0,1] )

Screen space is defined on the image plane. The camera projects objects
in camera space onto the image plane; the parts inside the screen window are visible
in the image that is generated. Depth z values in screen space range from zero to
one, corresponding to points at the near and far clipping planes, respectively.
Note
that, although this is called “screen” space, it is still a 3D coordinate system, since z
values are meaningful.

 

5. Normalized device coordinate (NDC) space:

(NDC 空间,值得注意的就是,在这个空间中,x,y 都已经是[0,1],z 当然也是[0,1],因为在上一个 Screen Space 已经变换过了,(0,0)点在图片的左下角)

This is the coordinate system for the
actual image being rendered. In x and y, this space ranges from (0, 0) to (1, 1),
with (0, 0) being the upper-left corner of the image. Depth values are the same as
in screen space and a linear transformation converts from screen to NDC space.

 

6. Raster space:

(基本上和 NDC空间一致,但是 x,y 不是 [0,1],而是 (0, 0) to (xResolution, yResolution).)

This is almost the same as NDC space, except the x and y coordinates
range from (0, 0) to (xResolution, yResolution).

 

 

Coordinate System Handedness

There are two different ways that the three coordinate axes can be arranged, as shown
in Figure 2.2. Given perpendicular x and y coordinate axes, the z axis can point in
one of two directions. These two choices are called left-handed and right-handed. The
choice between the two is arbitrary, but has a number of implications(暗示) for how some of
the geometric operations throughout the chapter are defined. pbrt uses a left-handed
coordinate system.

Figure 2.2: (a) In a left-handed coordinate system, the z axis points into the page when the x and y
axes are oriented with x pointing to the right and y pointing up. (b) In a right-handed system, the z
axis points out of the page.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值