Coordinate Transformations(坐标系的变换)

本文介绍了三维图形学中的坐标变换,包括平移、旋转和缩放。通过变换矩阵,可以移动、旋转和调整物体的大小。单位矩阵在变换中扮演重要角色,它是所有变换的基础。平移矩阵通过添加平移向量实现移动,旋转矩阵则根据旋转轴和角度构建。此外,文章还提到了欧拉角的概念及其潜在问题,以及缩放矩阵用于改变物体尺寸。
摘要由CSDN通过智能技术生成

周一到周五,每天一篇,北京时间早上7点准时更新~

As noted, coordinates may be moved from space to space by multiplying their vector representations by transformation matrices(如同提到过的那样,坐标可以通过乘以变换矩阵从一个空间转换到另一个空间). Transformations are used to manipulate your model and the particular objects within it(变换主要是用来去计算特定空间中你的模型以及某些特定的物体). These transformations move objects into place, rotate them, and scale them(这些变换把物体移动到某个位置,旋转他们,缩放他们). Figure 4.8 illustrates three of the most common modeling transformations that you will apply to your objects(图4.8显示了三个最常见的你会应用到你物体上的模型变换). Figure 4.8(a) shows translation, in which an object is moved along a given axis(图4.8a显示了平移,这里是把一个物体沿着一个给定的坐标轴平移). Figure 4.8(b) shows a rotation, in which an object is rotated about one of the axes(图4.8b显示了旋转,物体绕着某个轴旋转). Finally, Figure 4.8(c) shows the effects of scaling, where the dimensions of the object are increased or decreased by a specified amount(最后图4.8c中显示了缩放物体). Scaling can occur non-uniformly (the various dimensions can be scaled by different amounts), so you can use scaling to stretch and shrink objects(各方向上的缩放可以不一样,这样一来你就可以来挤压物体)
Coordinate Transformations(坐标系的变换)
Each of these standard transforms can be represented as a matrix by which you can multiply your vertex coordinates to calculate their positions after the transformation(每一个标准变换可以表示成为使用一个矩阵乘以你的坐标). The following subsections discuss the construction of those matrices, both mathematically and using the functions provided in the vmath library(接下来的章节从数学意义上以及vmath库的角度讨论矩阵的构造)

The Identity Matrix(单位矩阵)

There are a number of important types of transformation matrices you need to be familiar with before we start trying to use them(在你开始使用矩阵之前,你需要先了解一些非常重要的矩阵类型). The first is the identity matrix(第一个就是单位矩阵). As shown below, the identity matrix contains all zeros except a series of ones that traverse the matrix diagonally. The 4 × 4 identity matrix looks like this:(如同下面展示的这样,单位矩阵是一个对角阵,除了对角线上的元素以外,其他地方都是0,,4x4的单位矩阵长相如此:)
Coordinate Transformations(坐标系的变换)
Multiplying a vertex by the identity matrix is equivalent to multiplying it by 1; it does nothing to it(与单位矩阵相乘,向量不变)

Coordinate Transformations(坐标系的变换)
Objects drawn using the identity matrix are untransformed; they are at the origin (last column), and the x, y, and z axes are defined to be the same as those in eye coordinates(使用单位矩阵去对物体进行变换,物体不会有什么变化). Obviously, identity matrices for 2 × 2 matrices, 3 × 3 matrices, and matrices of other dimensions exist and simply have ones in their diagonal(很显然,2、3和其他维度的单位矩阵也是存在的,所有的单位矩阵都是方阵&#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值