您好,欢迎访问三七文档
计算机图形学讲义-10Viewing(I)Basedon[EA],Chapter5.姜明北京大学数学科学学院更新时间2020年1月30日星期四10时20分36秒计算机图形学讲义-10Outline•ClassicalandComputerViewing•ViewingwithaComputer•PositioningoftheCamera•SimpleProjections•ProjectionsinOpenGL计算机图形学讲义-10ClassicalandComputerViewing•ClassicalViewing•OrthographicProjections•AxonometricProjections•ObliqueProjections•PerspectiveViewing计算机图形学讲义-10Synthetic-cameraModel•Theprojectorsmeetatthecentreofprojection(COP).•TheCOPcorrespondstothecenterofthelensinthecameraorintheeye.•Itistheoriginofthecameraframeingraphicssystems.•Theprojectionsurfaceisaplane.Theprojectorsarestraightlines,basedongeometricoptics.Theclassofprojectionsisalsocalledplanargeometricprojections.•AstheCOPismovedtoinfinity,theprojectorsbecomeparallelandtheCOPcanbereplacedbyadirectionofprojection(DOP).•ViewswithafiniteCOParecalledperspectiveviews.•ViewswithaCOPatinfinityiscalledparallelviews.计算机图形学讲义-10•Computergraphicssystemshavetwofundamentaltypesofviewing(parallelandperspective).•Classicalgraphicsappearstopermitahostofdifferentviews.•Classicalviewingintendstoshowaspecificrelationshipamonganobject,theviewerandtheprojectionplane.•Computergraphicssystemspreferscompleteindependenceofallspecifications.计算机图形学讲义-10ClassicalViewingEachclassicalviewisdeterminedbythespecificrelationshipbetweentheobjectsandviewer.计算机图形学讲义-10OrthographicProjectionsOrthographicprojectionsTempleandthreemultivieworthographicprojections计算机图形学讲义-10AxonometricProjection•轴测投影(a)Constructionoftrimetric-viewprojection;(b)topview;(c)sideview.计算机图形学讲义-10ObliqueProjections(a)Constructionofobliqueviewprojection;(b)topview;(c)sideview.计算机图形学讲义-1010Angel:InteractiveComputerGraphics5E©Addison-Wesley2009PerspectiveProjection•Projectorscovergeatcenterofprojection计算机图形学讲义-1011Angel:InteractiveComputerGraphics5E©Addison-Wesley2009VanishingPoints•Parallellines(notparalleltotheprojectionplan)ontheobjectconvergeatasinglepointintheprojection(thevanishingpoint)•Drawingsimpleperspectivesbyhandusesthesevanishingpoint(s)vanishingpoint计算机图形学讲义-1012Angel:InteractiveComputerGraphics5E©Addison-Wesley2009Three-PointPerspective•Noprincipalfaceparalleltoprojectionplane•Threevanishingpointsforcube计算机图形学讲义-1013Angel:InteractiveComputerGraphics5E©Addison-Wesley2009Two-PointPerspective•Onprincipaldirectionparalleltoprojectionplane•Twovanishingpointsforcube计算机图形学讲义-1014Angel:InteractiveComputerGraphics5E©Addison-Wesley2009One-PointPerspective•Oneprincipalfaceparalleltoprojectionplane•Onevanishingpointforcube计算机图形学讲义-1015Angel:InteractiveComputerGraphics5E©Addison-Wesley2009AdvantagesandDisadvantages•Objectsfurtherfromviewerareprojectedsmallerthanthesamesizedobjectsclosertotheviewer(diminution)–Looksrealistic•Equaldistancesalongalinearenotprojectedintoequaldistances(nonuniformforeshortening)•Anglespreservedonlyinplanesparalleltotheprojectionplane•Moredifficulttoconstructbyhandthanparallelprojections(butnotmoredifficultbycomputer)计算机图形学讲义-10ViewingwithaComputer•Viewingconsistsoftwofundamentaloperations.•1stwemustpositionthecamera.–Thisisthejobofthemodel-viewtransformations,–Afterverticespassthroughthistransformation,theyareinthecameraframe.•2ndstepistheapplicationoftheprojectiontransformation.–Itappliesthespecifiedprojection–orthographicorperspective–totheverticesandputsobjectswithinthespecifiedclippingvolumeinanormalizedclippingvolume.•DefaultcamerainOpenGL–thecameraisattheorigin,–pointingtothenegativez-direction,–orthographicview,–Clippingvolumecenteredattheorigin,ofsidelength2.计算机图形学讲义-10PositioningoftheCamera•Ourstartingpointistheworldframe.•Wedescribethecamera’spositionandorientationinthisframe.•Theprecisetypeofimagethatwewishtoobtain–perspectiveorparallel–isdeterminedseparatelybytheprojectionmatrixinOpenGL,thenormalizationtransformation.•Thecameraispositionedinitiallyatitsdefaultlocationandorientation,pointingtothenegativez-direction.计算机图形学讲义-10•Itsdesiredlocationiscenteredatapointcalledtheview-referencepoint(VRP),givenintheworldframe.•Itsorientationisspecifiedbytheview-planenormal(VPN)andview-upvector(VUP).–VPNgivestheorientationoftheprojectionplane,orbackofthecamera.–VUPfixestheprojectionplaneorthebackofthecamera.•WeprojecttheVUPvectorontheviewplanetoobtaintheup-directionvectorv.•Wecancomputea3rdorthogonaldirectionu.•Thisneworthogonalsystemiscalledtheviewing-coordinatesystemortheu-v-nsystem.•ItisthecameraframewiththeadditionoftheVRP.•Thefinaltransformationmatrix.10000001upupvnvvnnnuvnuvnMVM计算机图形学讲义-10TheLook-atFunction•Thecameraislocatedatapointecalledtheeyepoint,specifiedintheworldframe.•Itpointsatasecondpointa,calledtheatpoint.•ThesepointsdetermineaVPNandVRP.–vpn=e–a.–vrp=e•WeonlyneedtospecifytheVUPdirectionforthecamera.•TheOpenGLutilityfunction–gluLookAt(eyex,eyey,eyez,atx,aty,atz,upx,upy,upz);•altersthemodel-viewmatrixforacameraalongthisline.计算机图形学讲义-10OtherViewingAPIs计算机图形学讲义-10SimpleProjections•PerspectiveProjections•OrthogonalProjections计算机图形学讲义-10PerspectiveProjections,pppzdpzdzdxxxxzdyyThedivisionbyzdescribesnon-uniformforeshortening(透视缩短)––imagesofobjects
本文标题:Viewing
链接地址:https://www.777doc.com/doc-3399223 .html