《计算机图形学教学资料》(1)ppt课件_第1页
《计算机图形学教学资料》(1)ppt课件_第2页
《计算机图形学教学资料》(1)ppt课件_第3页
《计算机图形学教学资料》(1)ppt课件_第4页
《计算机图形学教学资料》(1)ppt课件_第5页
已阅读5页,还剩43页未读 继续免费阅读

下载本文档

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

文档简介

1、Chapter 4 Geometrical Transformations1.Vector(矢量2.Matrix矩阵Mathematics Preparation for transformation1两个矢量之和:矢量运算(Vector)2两个矢量的点积:21212121zzyyxxVV),(21212121zzyyxxVV3矢量的长度:2111111121111)()(zzyyxxVVV矢量运算4两个矢量的叉积:),(),(12211221122122112211221122211121yxyxxzxzzyzyyxyxxzxzzyzyzyxzyxkjiVVNoImagemnmmnnaaaa

2、aaaaaA212221111211aij是矩阵中第i行第j上的元素。上述矩阵记为A,或AmXn,或(aij) mXn。矩阵(matrix)Cont.ndefinition:mnmmnnmnaaaaaaaaaA212222111211m=n时:A称为方阵m=1时:退化为行向量(vector)n=1时:退化为列向量(vector) 时:称为A=Bijijba n nm mn na aa aa aA A11211 Cont.n单位矩阵:100010001nnIn零矩阵:0000000000mnICont.n矩阵加法:mnmnmnCBAijijijbac其中:n矩阵加法满足的运算律:n结合律n交换律

3、nA+0=ACont.n矩阵数乘mnmmnnmnijmnkakakakakakakakakakakA212222111211)(Cont.n矩阵乘法:mpnpmnCBAnlljilijbac1其中:n矩阵乘法满足的运算律:n结合律n分配律nAI=IA=An不满足交换律!Cont.n矩阵转置nmmnnnmmTmnBaaaaaaaaaA212221212111n矩阵转置运算律:TTTTTTTTTTABBAkAkABABAAA)()4()()3()()2()() 1 (Cont.n矩阵行列式n非奇特矩阵n逆矩阵:非奇特矩阵具有逆矩阵IAAAA11假设把n维空间坐标叫做普通坐标,那么相应的n+1维空间

4、坐标叫做齐次坐标. 齐次坐标技术:用n+1维向量表示n维向量的技术ordinary coordinatehomogeneous coordinate(x,y)(hx,hy,h)其中,h是一个恣意的非零标量齐次坐标(homogeneous coordinate)齐次坐标(homogeneous coordinate)0),(),(0),(),(hhhzhyhxzyxhhhyhxyx1husually那么 (x,y)的齐次坐标为(x,y,1)Cont.xyW The XYW homogeneous coordinate space, with the W = 1 plane and point P

5、( X, Y, W ) projected onto the W = 1 plane.PRepresentation of 2D transformations1001232221131211yxcycxcycycxcx11001232221131211yxccccccyxRotate, scale, symmetry, sheartranslateEntire scaleproject代数式矩阵式3D spacen右手直角坐标系XYZnPoints: zyxPAlgebraic representation of 3D transformations100013433323124232221

6、14131211zyxazayaxazazayaxayazayaxax),( :),( :zyxafterzyxbefore;Matrix representation1144434241343332312423222114131211zyxaaaaaaaaaaaaaaaazyxnIntroduce homogeneous coordinate0 0 0 1变换的两种实现方法: (1)坐标系不变,图形变换; (2)图形不变,坐标系变换.Transformation method4.1 2D transformations nTranslate(平移) transformationsnRotat

7、e(旋转) transformationsnScale(缩放) transformationsnReflect(反射) transformationsnShear(错切) transformationsnComposition(复合) of 2D transformations 在二维坐标系中,将点P(x,y)在x、y轴方向分别平移tx、ty,得到点P(x,y),那么P点与P点的坐标关系为: yxtyytxx变换矩阵:T=yxtt矢量方式为:P=P+TTranslate transformations(平移变换)Before translationAfter translation(4,5)(

8、7,5)xy(7,1)(10,1)xy yxttyxyxCont.用齐次坐标表示平移变换过程:.1001001,1,1 yxttTyxPyxPPTP Whereas:Translate matrixCont.nTranslating an object: translate is an rigid-body transformationnTranslating every point of the objectnTranslating the key-point of the object and re-defining the objectnConverse transformation:1

9、0010011yxttTP(x,y)P(x,y)OrP1P1)sin()cos(ryrxsincosryrxRotate transformations(refer to origin)sinsincoscosrrsincoscossinrrsincossincosxyyyxxsincossincosxyyyxxCont.变换矩阵:1000cossin0sincos)(RPRP)( 那么变换公式为:vPositive : anti-clockwise rotate(逆时针) vNegative : clockwise rotate(顺时针)逆变换逆变换:)(RCont.nRotating an

10、 object图元的旋转变换n旋转变换是刚体变换nRotating every point of object through the same anglenBe rigid-body transformations: rotating the key-point and re-defining the objectCont.Rotation of a house. The house also changes positionBefore rotation(9,2)(5,2)xyAfter rotationxy(2.1,4.9)(4.9,7.8)固定某个点的旋转变换?Scaling tran

11、sformations1ysyxsxyx变换矩阵:1000000yxssS变换公式:1),(1yxssSyxyx缩放变换是指对点的缩放变换是指对点的X,Y坐标值进展缩放。坐标值进展缩放。Sx , Sy 称为缩放系数,可取任何正数; S称为缩放矩阵。缩放变换可使物体产生重定位,如右图所示,缩放比例不同,定位间隔也不同。当缩放系数大于1时,物体被放大,否那么减少;当SxSy时,物体发生等比变换,否那么发生差值缩放,产生变形。Scaling transformations2P0P1OP1P0Scaling an objectnPolygon多边形nScaling the vertexes and t

12、hen re-defining the polygonncircle圆中心对称图形nScaling the radiusnPrimitives defined by some parameters给定定义参数的图形nScaling the parameters and re-defining the primitivesyyxx相对X轴对称:Symmetry transformations变换矩阵:100010001xSY变换公式:11yxSYyxx对称变换是产生物体镜象的一种变换.Cont.相对Y轴对称:11000100011yxyxyyxxCont.11000100011yxyx相对原点对

13、称:yyxxCont.11000010101yxyx11000010101yxyx相对y=x直线对称:相对y=-x直线对称:xyyxxyyx错切变换:坚持图形上各点的某一坐标值不变,错切变换:坚持图形上各点的某一坐标值不变,而另一坐标值关于该坐标值呈线性变化。而另一坐标值关于该坐标值呈线性变化。坐标坚持不变的坐标轴称为倚赖轴,其它坐标坐标坚持不变的坐标轴称为倚赖轴,其它坐标轴称为方向轴。轴称为方向轴。(1)以以y轴为依赖轴的错切变换轴为依赖轴的错切变换(沿沿x方向的错切方向的错切 即即y不变,不变,x的值随的值随y的值而线性变化的值而线性变化yyyshxxxShx=tan Shear tran

14、sformationsyxshyxxyShy=tan (2)以x轴为依赖轴的错切变换Cont.Cont.nTwo kinds:nShear along x axisnShear along y axisnGeneral representation of shear:11bxydyxyxb=0 or d=011000101yxbd变换合成n根据矩阵运算的性质,可推出二维根本变换的如下性质:n平移变换和旋转变换具有可加性n缩放变换具有可乘性),(),(),(21211122yyxxyxyxttttTttTttT)()()(2112RRR),(),(),(21211122yyxxyxyxssssS

15、ssSssSRotate transformation about arbitrary point),()(),(0000yxyxTRTT总),(yx),(yx),(yx),(yx),(00yx),(yx),(yx),(00yxPTPyx),(00)( PRP ),( 00PTPyx),(00yxSuppose the point is then the transformation can be composed by some fundamental transformations Translation(T)Rotation(R)Inverse translationT=T-1R TCo

16、nt.Scaling about arbitrary pointnReference point: , fix up point before and after scaling),(refrefyxComposition of translate, scale about origin, and inverse translate transformationsCont.1100)1 (0)1 (01yxsyssxsyxyrefyxrefxNamely:PTSTPrefrefyxrefrefyxssyx),(),(),(Symmetry about arbitrary lineTRSYRTTX11总TRSY1R1T作业:关于恣意直线的对称变换直线为 y= x+b写出 T总33Exercises nExercise 4.1 nProve that we can transform a line by transforming its endpoints and then constructing a new line between the transformed endpoints.n经过变换后的两个端点可定义变换后的直线Exercises nExe

温馨提示

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

评论

0/150

提交评论