资源描述:
《计算机图形学-二维和三维观察.pptx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、二维及三维观察回顾第三章讲的基本概念Startfrom3Dobjectandfinallydisplayedonthe2DscreenTheobjectsarebeingtransformedtovariousspaces,theyinclude建模坐标系(局部坐标系)世界坐标系观察坐标系(CameraSpace)规范化坐标系设备坐标系(屏幕坐标系)DifferentSpacesinGraphicsFromEgonRath’sNotesDifferentSpacesinGraphicsToconvertbetweenspaces,differentmatricesareinvolve
2、dModelMatrix(Fromobjectspacetoworldspace)ViewMatrix(Fromworldspacetocameraspace)ProjectionMatrix(Fromcameraspacetoscreenspace)建模坐标系Localcoordinatesystemofthe3DgeometricalobjectsInOpenGL,itisthespacewheneverthe3DgeometryisbeingcreatedE.g.acubecreatedaboutoriginThevertices’coordinates:(-1,1,1),(-
3、1,-1,1),(1,-1,1),(1,1,1),(-1,1,-1),(1,1,-1),(1,-1,-1),(-1,-1,-1)世界坐标系ThespacewhereallobjectsarepositionedE.g.ourcubearemovedtothedesiredplaceintheworldspace’scoordinateframeWecandothisbymultiplyingtheverticesofthecubewiththeModelMatrixWorldSpaceFrame建模坐标系到世界坐标系的转换Avertex(-1,1,1)inobjectspaceisg
4、oingtotransformintoworldspacebythefollowingMatrixMmodelMmodel=Mmodelv===观察坐标系Thespacewherethecameraisbeingthecenter(origin)MovingaVideoCameraBackwardisthesameasmovingthefilmedobjectforwardWorldSpaceFrameCameraSpaceFrame世界坐标系到观察坐标系Avertex(9,-2,-5)inworldspaceisgoingtotransformintocameraspacebyth
5、efollowingMatrixMviewMview=Mviewv===CameraSpace/EyeSpaceInsomerenderingengine,e.g.OpenGL,theCameraisalwayssetattheworld’scenterSo,TheModelandViewMatrixarebeingcombinedtoformtheModelViewMatrixinsteadUsingtheexamplesaboveMmodelview=MmodelMview=屏幕坐标系Inthecameraspace,wealreadyhaveallverticesinaposi
6、tionviewingfromthecameraThelastprocessistheprojectionof3Dverticestothe2Dcoordinatesonthescreen/filmofacameraWorldSpaceFrameCameraSpaceFrame裁减窗口与视口裁减窗口二维场景中要显示的部分视口指定在输出位置的什么位置进行观察将不同尺寸的裁减窗口连续映射到固定尺寸的视口中,则可以得到“拉镜头”的效果通过将一个固定尺寸的裁减窗口移过场景中的不同位置,可以产生“移镜”的效果裁减窗口和视口一般是正则矩形二维观察流水线二维应用的观察坐标系和世界坐标系一致世界坐标
7、系中指定一个观察坐标系规范化坐标系裁减工作通常在规范化设备坐标系中进行规范化和视口变换三维观察流水线三维观察坐标系的设定观察点观察方向观察向上方向投影平面使用一个标量参数设定观察平面沿z轴方向的位置对象到观察平面的投影与场景在输出设备的显示对应观察平面法向量图形系统中,如何确定观察平面法向量观察向上向量一般通过世界坐标系获取,但需调整到与z轴垂直的方向uvn观察坐标系通过观察平面法向量N及观察向上向量V来获得Y轴方向计算V和N的叉积可得到正确的U的方向并形