《计算机图形学教学资料》

上传人:壹****1 文档编号:578502209 上传时间:2024-08-24 格式:PPT 页数:53 大小:487.50KB
返回 下载 相关 举报
《计算机图形学教学资料》_第1页
第1页 / 共53页
《计算机图形学教学资料》_第2页
第2页 / 共53页
《计算机图形学教学资料》_第3页
第3页 / 共53页
《计算机图形学教学资料》_第4页
第4页 / 共53页
《计算机图形学教学资料》_第5页
第5页 / 共53页
点击查看更多>>
资源描述

《《计算机图形学教学资料》》由会员分享,可在线阅读,更多相关《《计算机图形学教学资料》(53页珍藏版)》请在金锄头文库上搜索。

1、4.2 3D transformations nTranslate(平移) transformationsnScale(缩放) transformationsnShear(错切) transformations nRotate(旋转) transformationsnReflect(反射) transformationsnComposition(复合) of 3D transformationsn与二维平移变换类似地使用齐次坐标表示为:记为:其中Translate transformation记为:Scale transformationnAbout originCont.nAbout arb

2、itrary pointThe arbitrary reference point is :Cont.nAbout arbitrary pointtranslate, scale about origin, inverse translatenConsists of:nThe arbitrary reference point is :Cont.则变换矩阵为:Shear transformationsnDependence axis(依赖轴): corresponding coordinate is remained nDirection axis(方向轴): corresponding co

3、ordinate is changed linearly nRepresentations:n变换的一般表达式是:Shear transformationsnParameters: rotate axis, rotate anglen二维旋转变换是三维空间中绕Z轴的旋转记为:XYZRotate transformationRotate about X axisEqually with changing the coordinate system x,y,z to the coordinate system y,z,x. YZXXYZRotate about Y axisChanging sys

4、tem x,y,z to system z,x,yZXYXYZ?:about arbitrary linen是关于某直线或平面进行的n关于某个轴进行的反射变换等同于关于该轴做180度的旋转变换nFor instance: about Z axisReflect transformation(反射变换)?:about arbitrary symmetry axisCont.n当反射平面是坐标平面时,等同于进行左、右手坐标系的互换,相应变换矩阵是把第三维坐标值取反nFor instance: about XOY plane?About arbitrary symmetry planenFor in

5、stance: rotating about arbitrary line Overlapping arbitrary line with Z axisnResolving a series of problems nReflect about an arbitrary symmetry linenReflect about an arbitrary symmetry plane Composition transformationsn旋转轴不与坐标轴重合时变换的实现:n经复合变换使旋转轴与某坐标轴重合n绕指定轴进行旋转变换n还原坐标系YZXP1P2Rotate about arbitrary

6、 line(1)translate P1 to overlap origin不妨设P1P2为方向单位矢量,P2点坐标为(a,b,c)YZxP1P2YZxCont.XYZOP1P2XYZCont.Cont.P1P2XYZ(2)rotate about X axis to put the line on XOZXYZCont.(2)rotate about X axis to put the line on XOZXYZCont.(2)rotate about X axis to put the line on XOZXYZCont.(2)rotate about X axis to put th

7、e line on XOZXYZCont.(2)rotate about X axis to put the line on XOZXYZCont.(2)rotate about X axis to put the line on XOZXYZCont.(2)rotate about X axis to put the line on XOZXYZCont.(2)rotate about X axis to put the line on XOZThen P2 is (a,0,d)Transformation matrix(变换矩阵)XYZCont.(3) Rotate about Y axi

8、s to overlap the line with Z axisXYZCont.XYZ(4) Rotate about Z axis namely the line through Cont.XYZP1P2Cont.(4)recover the coordinate systemThe final transformation is: R()=T1-1Rx-1(-)Ry-1() Rz()Ry()Rx()T1Cont.n关于任意直线(或平面)的反射可以分解为平移、旋转(使得指定的反射直线或平面与某坐标轴或平面重合)和关于坐标直线(或坐标平面)的反射,再加恢复变换。Exercises out c

9、lassroomExercise 4.11Given a unit cube with one corner at (0,0,0) and another opposite corner at (1,1,1),derive the transforations necessary to rotate the cube by degree about the main diagonal(对角线) (from( 0,0,0) to (1,1,1) in the counterclockwise direction when looking along the diagonal toward the

10、 origin. Exercises out classroomExercise 4.14An object is to be scaled by a factor S in the direction whose direction cosines are (,).Derive the transformation matrix .Two methods of transformationnCoordinate system fixed, Graphics changednGraphics fixed, Coordinate system changed (1)坐标系不变,图形变换; (2)

11、图形不变,坐标系变换.变换的两种实现方法:Transforming coordinate systemnTwo means:nDefine the new coordinate system directlynDefine a vector in y direction of the new coordinate systemCont.1. Define a new system: composition of transformations(x0,y0)(1) translate: T(-x0,-y0)(2) rotate:R(-)(3) scale(4) composition of ab

12、ove transformations (notice the sequence)Cont.nThe matrix is:Cont.2. Define a vector in y direction of new system:Y axis is: (x0,y0)(x1,y1)X axis is:Transformation is:Contrast (x0,y0)(x0,y0)(x1,y1)VS.XYZXYZnTransform from an old coordinate system to another new coordinate systemnThe new system is sh

13、own in the right figure:Mode transformationCont.nComposition of translation and rotation:当坐标系使用不同的缩放时,还需定义缩放补偿。4.3 window-to-viewport transformationnWorld Domain(用户域WD)n指程序员用来定义草图的整个自然空间.nWorld-coordinate system(用户坐标系WC).n世界坐标系n右手直角坐标系nWindow(窗口区W)n在用户坐标系(世界坐标系WC)中预先选定的将产生图形显示的区域称为窗口Related concepts

14、Cont.nScreen Domain(屏幕域SD)n设备输出图形的最大区域,是有限的整数域.nViewport(视图区V)n在显示器坐标系中规定的显示图形的区域称为视(图)区.nScreen coordinates(屏幕坐标系)n(normalized) device coordinatesndevice coordinates: addressing by pixelsnNDC: -1,1-a,a窗口的取景器作用Window as a viewfinder利用窗口尺寸变化改变显示图形的大小 选窗口的视见变换选窗口的视见变换Cont.n视见变换将用户坐标系中窗口内的图形变换到显示器中的视见区

15、中产生显示.Window-to-Viewport transformationwindowWxlWxrWybWytP(x,y)VxlVxrviewportVybVytP(x,y)Cont. Cont.transform matrix窗口WxlWxrWybWytWxlWxrWybWyt-VxlVxrVybVyt-VxlVxrvybVytCont.VxlVxrVybVytNDC-to-DC transformationnNDC: -1,1-a,anDC: 0,M-10,N-1nConsidering its discrete feature: -0.5,M-1.5-0.5,N-1.5nThe same linear transformation as the W-to-V transformationnWhereas:Flow chart of 2D viewWC世界坐标系内的变换NDC规格化坐标系到设备坐标系的变换对窗口区进行裁剪WCDC设备输出二维图形显示流程窗口到视图区的规格化变换WC

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 研究生课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号