大三05计算机图形学_第1页
大三05计算机图形学_第2页
大三05计算机图形学_第3页
大三05计算机图形学_第4页
大三05计算机图形学_第5页
已阅读5页,还剩22页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1Representation几何表示原著Ed AngelProfessor of Computer Science, Electrical and Computer Engineering, and Media ArtsUniversity of New Mexico编辑 武汉大学计算机学院图形学课程组2ObjectivesIntroduce concepts such as dimension and basis维数与基等概念Introduce coordinate systems for representing vectors spaces Introduce frames for r

2、epresenting affine spacesDiscuss change of frames and bases讨论基与标架的变换Introduce homogeneous coordinates引进齐次坐标3Outline4.3 Coordinate System and Frames坐标系与标架4.3.1 - 4.3.64.4 Frames in openGL openGL 中的标架44.3 Coordinate System and Frames (Linear Independence线性无关)A set of vectors v1, v2, , vn is linearly i

3、ndependent if一组向量v1, v2 , vn称为线性无关的,是指 a1v1+a2v2+. anvn=0 iff a1=a2=0If a set of vectors is linearly independent, we cannot represent one in terms of the others如果一组向量是线性无关的,那么不能把其中一个向量表示成其它向量的线性组合If a set of vectors is linearly dependent, as least one can be written in terms of the others如果一组向量是线性相关

4、的,那么其中至少有一个向量可以表示为其它向量的线性组合54.3 Coordinate System and Frames (Dimension维数)In a vector space, the maximum number of linearly independent vectors is fixed and is called the dimension of the space在向量空间中,最大的线性无关向量组的元素个数是固定的,这个数就称为空间的维数In an n-dimensional space, any set of n linearly independent vectors

5、form a basis for the space在n维空间中,任意n个线性无关的向量构成空间的基Given a basis v1, v2,., vn, any vector v can be written as给定空间的一组基v1, v2 , vn,空间中任意向量v都可以表示为 v=a1v1+ a2v2 +.+anvnwhere the ai are unique其中i是唯一的64.3 Coordinate System and Frames(Representation表示)Until now we have been able to work with geometric entit

6、ies without using any frame of reference, such as a coordinate system到现在为止我们只是讨论几何对象,而没有使用任何参考标架,例如坐标系Need a frame of reference to relate points and objects to our physical world.需要一个参考标架把点和对象与物理世界中的对象联系在一起For example, where is a point? Cant answer without a reference system例如,点在哪儿?如果没有参考系的话,就无法回答这个

7、问题World coordinates世界坐标系Camera coordinates照相机坐标系4.3 Coordinate System and Frames(Representation表示)世界坐标系:是系统的绝对坐标系,在没有建立用户坐标系之前画面上所有点的坐标都是以该坐标系的原点来确定各自的位置的。784.3 Coordinate System and Frames (Coordinate Systems坐标系)Consider a basis考虑n维向量空间的基 v1, v2,., vnA vector is written一个向量v可以表示为 v=a1v1+ a2v2 +.+an

8、vnThe list of scalars标量a1, a2, . an is the representation of v with respect to the given basis就称为v相对于给定基的表示We can write the representation as a row or column array of scalars可以把表示写成列向量a=a1 a2 . anT=94.3 Coordinate System and Frames (Example)v=2v1+3v2-4v3a=2 3 4TNote that this representation is with

9、respect to a particular basis注意上述表示是相对一个特定的基而言的For example, in OpenGL we start by representing vectors using the object basis but later the system needs a representation in terms of the camera or eye basis 例如,在OpenGL中刚开始是相对于对象坐标系表示向量的,稍后要把这个表示变换到照相机坐标系(或者称为视点坐标系)中104.3 Coordinate System and Frames (

10、Coordinate Systems)Which is correct?Both are because vectors have no fixed location都正确,因为向量没有固定位置vv114.3 Coordinate System and Frames (Frames标架)A coordinate system is insufficient to represent points坐标系是不足于表示点的If we work in an affine space we can add a single point, the origin, to the basis vectors

11、to form a frame如果要在仿射空间中考虑问题,那么可以在基向量组中增加一个点(称为原点),从而构成一个标架(frame)v1v3P0v2124.3 Coordinate System and Frames (Representation in a Frame标架中的表示)Frame determined by标架是由(P0, v1, v2, v3)确定的Within this frame, every vector can be written as在这个标架中,每个向量可以表示为 v=a1v1+ a2v2 +.+anvnEvery point can be written as每

12、个点可以表示为 P = P0 + b1v1+ b2v2 +.+bnvn134.3 Coordinate System and Frames (Confusing Points and Vectors点与向量的混淆问题)Consider the point and the vector考虑点与向量 P = P0 + b1v1+ b2v2 +.+bnvn v=a1v1+ a2v2 +.+anvnThey appear to have the similar representations它们看起来具有相似的表示:p=b1 b2 b3 v=a1 a2 a3which confuses the poi

13、nt with the vectorA vector has no position这导致点与向量很容易混淆在一起vpvVector can be placed anywherepoint: fixed144.3.4 Homogeneous Coordinates (A Single Representation统一的表示)If we define 0P = 0 and 1P =P then we can write v=a1v1+ a2v2 +a3v3 = a1 a2 a3 0 v1 v2 v3 P0 T P = P0 + b1v1+ b2v2 +b3v3= b1 b2 b3 1 v1 v2

14、 v3 P0 TThus we obtain the four-dimensional homogeneous coordinate representation从而得到n+1维齐次坐标表示 v = a1 a2 a3 0 T p = b1 b2 b3 1 T点与向量的表示在齐次坐标表示下有明显区别154.3.4 Homogeneous Coordinates齐次坐标-1The homogeneous coordinates form for a three dimensional point x y z is given as三维点齐次坐标的一般形式为 p =x y z w T =wx wy

15、wz w TWe return to a three dimensional point (for w0) by可以通过下述方法给出三维点(当w 0): xx/w yy/w zz/w164.3.4 Homogeneous Coordinates齐次坐标-2If w=0, the representation is that of a vector当w = 0时,表示对应的是一个向量 p =x y z w T =wx wy wz w TNote that homogeneous coordinates replaces points in three dimensions by lines th

16、rough the origin in four dimensions齐次坐标表示中把四维空间中过原点的条直线对应于三维空间中的一个点For w=1, the representation of a point is x y z 1174.3.4 Homogeneous Coordinates(Homogeneous Coordinates and Computer Graphics)Homogeneous coordinates are key to all computer graphics systems齐次坐标是所有计算机图形系统的关键All standard transformati

17、ons (rotation, translation, scaling) can be implemented with matrix multiplications using 4 x 4 matrices所有标准变换(旋转、平移、放缩)都可以应用44阶矩阵的乘法实现Hardware pipeline works with 4 dimensional representations硬件流水线体系可以应用四维表示For orthographic viewing, we can maintain w=0 for vectors and w=1 for points对于正交投影,可以通过w = 0

18、保证向量,w = 1保证点For perspective we need a perspective division对于透视投影,需要进行特别的处理:透视除法184.3.2 Change of Coordinate Systems变换坐标系Consider two representations of a the same vector with respect to two different bases. The representations are考虑同一个向量相对于两个不同基的表示,假设表示分别是v=a1v1+ a2v2 +a3v3 = a1 a2 a3 v1 v2 v3 T =b

19、1u1+ b2u2 +b3u3 = b1 b2 b3 u1 u2 u3 Ta=a1 a2 a3 b=b1 b2 b3where194.3.2 Change of Coordinate Systems (Representing second basis in terms of first用第一组基表示第二组基)Each of the basis vectors, u1,u2, u3, are vectors that can be represented in terms of the first basis u1,u2,u3中每个向量都可以用 第一组表示出来u1 = g11v1+g12v2+

20、g13v3u2 = g21v1+g22v2+g23v3u3 = g31v1+g32v2+g33v3v204.3.2 Change of Coordinate Systems (Matrix Form矩阵形式)The coefficients define a 3 x 3 matrix所有系数定义了一个33阶矩阵and the bases can be related by 两组基就可以如下联系see text for numerical examplesa=MTbM =214.3.5 Example Change of Frames改变标架We can apply a similar proc

21、ess in homogeneous coordinates to the representations of both points and vectors可以对同时表示点与向量的齐次坐标进行类似的操作Any point or vector can be represented in either frame任何点和向量都可以用它们中的一个表示出来We can represent Q0, u1, u2, u3 in terms of P0, v1, v2, v3 下一页pptConsider two frames:(P0, v1, v2, v3)(Q0, u1, u2, u3)P0v1v2

22、v3Q0u1u2u3224.3.5 Example Change of Frames (Representing One Frame in Terms of the Other)u1 = g11v1+g12v2+g13v3u2 = g21v1+g22v2+g23v3u3 = g31v1+g32v2+g33v3Q0 = g41v1+g42v2+g43v3 +g44P0Extending what we did with change of bases把基的改变方法推广可有defining a 4 x 4 matrix由此定义了44阶矩阵M =如何用标架v来表示标架u标架(基)之间的关系234.3

23、.5 Example Change of Frames (Working with Representations表示的变换-1)Within the two frames any point or vector has a representation of the same form点和向量具有同样形式a=a1 a2 a3 a4 in the first frame在第一个标架b=b1 b2 b3 b4 in the second frame在第二个标架where a4 = b4 = 1 for points and a4 = b4 = 0 for vectors 244.3.5 Exam

24、ple Change of Frames (Working with Representations表示的变换-2)and表示的变换The matrix M is 4 x 4 and specifies an affine transformation in homogeneous coordinates这里矩阵M是44阶,用齐次坐标定义一个仿射变换a = MT b表示(坐标点、向量)之间的关系b = (MT)-1 a254.3 Coordinate System and Frames (Affine Transformations仿射变换)Every linear transformation is equivalent to a change in frames每个线性变换等价于一次标架改变Every affine transformation preserves lines所有的仿射变换保持共线性However, an affine transformation has only 12 degrees of freedom because 4 of the elements in the matrix are fixed and are a subset of all possibl

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论