计算机图形学3D图形表示方式.ppt
Viewing In 3DChapter 5n如何在二维平面上显示三维物体n表示问题n遮挡关系的反映n真实感问题投影三维形体的表示消隐光照与着色The basic questions of 3D graphics3D viewing processClip againstviewvolumeProject ontoprojectionplaneTransform into viewport in 2D device coordinates for display3D world-coordinate output primitivesClipped world coordinates2D device coordinates primitivesFig.Conceptual model of the 3D viewing process.Conception Projections transform points in a coordinate system of dimension n into points in a coordinate system of dimension less than n.Projection Definition:The projection of a 3D object is defined by straight projection rays(called projectors)emanating from a center of projection,passing through each point of the object,and intersecting a projection plane to form the projection.ProjectionsProjections Parameter:n projection centern projection plane The class of projectionsn Perspective Projection The distance between the center of projection and the projection plane is finite.nParallel Projection The distance between the center of projection and the projection plane is infinite.The class of projectionsABABCenter of projectionprojectorsProjection plane(a)Fig.(a)perspective projection (b)parallel projection.ABABCenter of projectionprojectorsProjection plane(b)The subclasses of Planar Geometric Projections.Planar geometric projectionsParallel Perspective Orthographic Oblique Top(plan)Front elevationSide elevationAxonometricIsometricOther Other Cabinet Cavalier One-pointThree-pointTwo-point.Three Orthographic ProjectionsProjectors for top viewProjection plan (front view)Projectors for side viewProjectors for front viewProjection plan (top view)Projection plan (side view)Three Orthographic Projections(三视图)VUXYYZ主视图侧视图俯视图YZX正平行投影(三视图)VUXYYZ主视图侧视图俯视图txtztxtytytz(a,b)Front ElevationVUXYYZ主视图侧视图俯视图txtztxtytytzTop ElevationVUXYYZ主视图侧视图俯视图txtztxtytytzSide ElevationVUXYYZ主视图侧视图俯视图txtztxtytytzPerspective Projectionn Vanishing Point.The perspective projections of any set of parallel lines that are not parallel to the projection plane converge to a vanishing point.nAxis Vanishing Point If the set of lines is parallel to one of the principal axes,the vanishing point is called an axis vanishing point.The style of Perspective Projection Perspective projections are categorized by their number of principal vanishing points and therefore by the number of axes the projection plane cuts nOne-point perspective projection Projection-plane cuts only one of three axes.nTwo-point perspective projection Projection-plane cuts only two of three axes at the same time.nThree-point perspective projection Projection-plane cuts all of three axes at the same time.The style of Perspective ProjectionOne-point perspective projectionFig.Construction of one-point perspective projection of cube onto plane cutting the z axis.Projection-plane normal is parallel to z axis.xzyCenter of projectionProjection p l a n e n o r m a lProjection planeTwo-point and Three-point Perspective ProjectionFig.Two-point and three-point perspective projection of a cube.(a)Two-point perspective,the projection plane cuts the x and z axes.(b)Three-point perspective,the projection plane cuts three axes at the same time.(a)xzy(b)The mathematics of simple Perspective ProjectionParameter Equation of Line PcP:YZXPc(xc,yc,zc)P(x,y,z)Ps(xs,ys,zs)The intersection of the line PPc with the projection plane at z=0 is in the XOY plane One-point perspective projectionUnder the viewing-reference coordinate of uvn,Suppose:projection plane n=0,projection reference point(0,0,d),point p(up,vp,np)of three dim space,its projection point Q,Line Parameter Eq:Transformation of One-point perspective projection举例若假定投影参考点为(0,0,0),即观察坐标系的原点,投影平面为n=d,待投影的三维空间中的点是p(up,vp,np),投影点为Q,则直线方程是:XZ右手用户坐标系0 通常,在由三维物体转换成二维图形的假想相机模型中,物体首先被变换到在观察坐标系中描述,然后再投影到观察平面上成为二维图形.观察坐标系中的简单一点透视Y右手观察坐标系U0NVUN左手观察坐标系0V 在观察坐标系下,仍利用前述的简单一点透视的方法,可求观察坐标系上形体的一点(Xe,Ye,Ze)在视平面上的投影(Xs,Ys):(Xw,Yw,Zw)是用户坐标系下的点(Xe,Ye,Ze)是观察坐标系下的点(X,Y,Z)是投影点观察坐标系中的简单一点透视在观察坐标系中,视点为原点,(Xc,Yc,Zc)为(0,0,0),用户坐标系下的点(Xw,Yw,Zw)为(Xe,Ye,Ze),则有:观察坐标系中的简单一点透视如何完成从世界坐标系到观察坐标系的变换?观察变换n完成工作:n在世界坐标系下定义出观察坐标系,并推导世界坐标系到观察坐标系的变换矩阵。n实现步骤:n定义观察坐标系n世界坐标系变换到观察坐标系观察坐标系的定义VPN:投影平面法向VRP:观察参考点VUP:观察正向观察坐标系是依赖于投影平面(照相机的底片)建立的。投影平面VPnVUPVPNVRPvu观察坐标系的定义n坐标原点:n用户指定的观察点作为观察坐标系原点,记为Z坐标轴用户指定观察平面法向VPN作为Z轴正向,记为:通常可令观察坐标系的定义n观察坐标系的定义:n选择向上观察向量VUPn向上观察向量只需不与N方向平行即可,记为:V令:再令:显然U同时垂直于N和V矢量。则U、V、N两两垂直。令:定义Ouvn为观察坐标系(右手坐标系)。u右手观察坐标系Vvn世界坐标系到观察坐标系n等价于建模变换过程n引入观察坐标系记号:变换矩阵: