版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Projection Matrices投影矩阵原著Ed AngelProfessor of Computer Science, Electrical and Computer Engineering, and Media ArtsUniversity of New Mexico编辑 武汉大学计算机学院图形学课程组ObjectivesDerive the projection matrices used for standard OpenGL projections推导出在标准OpenGL投影中所用的投影Introduce oblique projections矩阵具体表示,介绍倾斜投影Intr
2、oduce projection normalization介绍投影规范化Outline5.8 Parallel-Projection Matrices平行投影矩阵5.8.1 Projection Normalization规范化5.8.2 Orthogonal-Projection Matrices正投影矩阵5.8.3 Oblique Projections倾斜投影5.9 Perspective-Projection Matrices透视投影矩阵5.9.1 Perspective Normalization透视规范化5.9.2 OpenGL Perspective Transformatio
3、n OpenGL透视规范化5.8 Parallel-Projection Matrices 平行投影矩阵5.8.1 Projection Normalization 投影规范化Rather than derive a different projection matrix for each type of projection, we can convert all projections to orthogonal projections with the default view volume不想为每种类型的投影设计不同的投影矩阵,所以把所有的投影转化为具有默认视景体的正交投影This s
4、trategy allows us to use standard transformations in the pipeline and makes for efficient clipping这种策略可以使我们在流水线中应用标准变换,并进行有效的裁剪5.8.1 Projection Normalization规范化把对象进行变形,使得变形后的对象经正交投影后得到与原对象的理想投影一样的视图规范化矩阵就是正交投影矩阵串乘上对象变形(distort)矩阵5.8.1 Projection Normalization规范化(Pipeline View流水线)model-view transform
5、ation模型视图projectiontransformation投影变换perspectivedivision透视除法clipping裁剪projection投影Nonsingular非奇异变换4D 3Dagainst default cube相对于默认立方体3D 2D5.8.1 Projection Normalization规范化(Notes-1)We stay in four-dimensional homogeneous coordinates through both the model-view and projection transformations在模型视图变换和投影变换
6、的过程中,我们是一直在四维齐次坐标系中的Both these transformations are nonsingular这些变换都是非奇异的Default to identity matrices (orthogonal view)默认值为单位阵(正交视图)5.8.1 Projection Normalization规范化(Notes-2)Normalization lets us clip against simple cube regardless of type of projection规范化使得不管投影的类型是什么,都是相对于默认的简单立方体进行裁剪Delay final pro
7、jection until end直到最后时刻才进行 投影处理Important for hidden-surface removal to retain depth information as long as possible从而可以尽可能的保留深度信息,这对隐藏面消除是非常重要的5.8.2 Orthogonal-Projection Matrices正投影矩阵(正则视景体)OpenGL缺省的视景体是中心在原点,边长为2的立方体,相当于调用glMatrixMode(GL_PROJECTION);glLoadIdentity();glOrtho(-1.0, 1.0, -1.0, 1.0, -
8、1.0, 1.0);称这个视景体为正则视景体(canonical view volume)5.8.2 Orthogonal-Projection Matrices正投影矩阵(Orthogonal Normalization正交规范化)glOrtho(left,right,bottom,top,near,far)normalization find transformation to convertspecified clipping volume to default规范化 求出把指定裁剪体转化为默认裁剪体的变换Figure 5.36 Mapping a view volume to the
9、canonical view volume5.8.2 Orthogonal-Projection Matrices正投影矩阵(Orthogonal Matrix正交规范化矩阵)Two stepsMove center to origin把中心移到原点,对应的变换为T(-(left+right)/2, -(bottom+top)/2,(near+far)/2)Scale to have sides of length 2进行放缩从而使视景体的边长为2S(2/(left-right),2/(top-bottom),2/(near-far)P = ST =5.8.2 Orthogonal-Proje
10、ction Matrices正投影矩阵(Final Projection最后的投影)Set z =0 Equivalent to the homogeneous coordinate transformation这等价于如下的齐次坐标变换Hence, general orthogonal projection in 4D is从而在4D中一般的正交投影为Morth = P = MorthST5.8.3 Oblique Projections倾斜投影The OpenGL projection functions cannot produce general parallel projection
11、s such as 投影函数不支持一般的平行投影,例如立方体的如下图示However if we look at the example of the cube it appears that the cube has been sheared此时立方体好像发生了错切,然后再进行正交投影Oblique Projection = Shear + Orthogonal Projection 倾斜投影= 错切正交投影5.8.3 Oblique Projections倾斜投影(General Shear一般的错切)top viewside viewFigure 5.40 Oblique clippin
12、g volume5.8.3 Oblique Projections倾斜投影(顶视图和侧视图)top viewside viewFigure 5.40 Oblique projection (a) Top view (b) side view volume5.8.3 Oblique Projections倾斜投影(Shear Matrix错切矩阵)xy shear (z values unchanged) xy 错切(z值不变)Projection matrix投影矩阵General case:一般情形 H(q,f) = P = Morth H(q,f) P = Morth STH(q,f) 5
13、.8.3 Oblique Projections倾斜投影(Equivalency等价性)Figure 5.45 Effect of shear transformation5.8.3 Oblique Projections倾斜投影(Effect on Clipping对裁剪体的影响)The projection matrix P = STH transforms the original clipping volume to the default clipping volume投影矩阵P = STH把原来的裁剪体变换为默认的裁剪体top viewDOPDOPnear planefar pla
14、neobjectclippingvolumez = -1z = 1x = -1x = 1 distorted object变形后的对象(projects correctly)5.9 Perspective-Projection Matrices透视投影矩阵5.9.1 Perspective Normalization 透视规范化(Simple Perspective简单透视)Consider a simple perspective考虑简单透视 with the COP at the origin:COP在原点, the near clipping plane at z = -1近裁剪面在z
15、= -1, and a 90 degree field of view determined by the planes由平面x = z, y = z确定的有90度的视野 x = z, y = z5.9.1 Perspective Normalization(Perspective Matrices透视矩阵)Simple projection matrix in homogeneous coordinates齐次坐标下的简单投影矩阵为Note that this matrix is independent of the far clipping plane注意这个矩阵与远裁剪面无关M =5.9
16、.1 Perspective Normalization(Generalization推广)N =after perspective division, the point (x, y, z, 1) goes to在透视除法后,点( x,z,1)变到了x = x/zy = y/zZ = -(a+b/z)which projects orthogonally to the desired point regardless of a and b 无论, 的值是什么,在正交透影后就得到所期望的点。此时矩阵N非奇异 x = z, y = zz=-nearz=-far5.9.1 Perspective
17、Normalization(Picking and 与的选取)If we pick如果取a = b = the near plane is mapped to那么近平面映射到 z = -1the far plane is mapped to远平面映射到z =1and the sides are mapped to各侧边映射到 x = 1, y = 1Hence the new clipping volume is the default clipping volume这样,新的裁剪体就是缺省裁剪体5.9.1 Perspective Normalization(Normalization Tra
18、nsformation规范变换)original clippingvolume原来的裁剪体original object原来的对象new clipping volume新裁剪体distorted object变形后的对象projects correctlyFigure 5.43 Perspective normalization of view volumeNormalization and Hidden-Surface Removal规范化与隐藏面消除-1Although our selection of the form of the perspective matrices may ap
19、pear somewhat arbitrary, it was chosen so that if z1 z2 in the original clipping volume then the for the transformed points z1 z2 虽然这里选择的透视矩阵形式上看起来有点儿任意,但这种选择保证如果在原来的裁剪体内z1z2, 那么变换后的点满足z1z2Normalization and Hidden-Surface Removal规范化与隐藏面消除-2Thus hidden surface removal works if we first apply the norm
20、alization transformation因此如果首先应用规范变化,隐藏面消除算法有效However, the formula z = -(a+b/z) implies that the distances are distorted by the normalization which can cause numerical problems especially if the near distance is small 然而,公式z = -(+/z)意味着由于规范化导致距离发生了改变,这可能导致数值问题,特别是当近距离非常小的时候更是如此5.9.2 OpenGL Perspecti
21、ve Transformation (OpenGL Perspective OpenGL的透视)glFrustum allows for an unsymmetric viewing frustum可以定义非对称视景体(尽管 gluPerspective does not不能做到这一点)Figure 5.44 OpenGL Perspective5.9.2 OpenGL Perspective Transformation(OpenGL Perspective Matrix OpenGL透视矩阵)The normalization in glFrustum requires an initial shear to form a right viewing pyramid, followed by a scaling to get the normalized perspective volume. Finally, the perspective matrix results in needing only a final orthogonal transformation 在glFrustum中的规范化需要进行一个初始剪切变换,从而形成一个视景棱台,接着进行放缩变换,得到规范后的透视视
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026广西防城港市第一人民医院招聘劳务派遣人员12人备考题库及一套答案详解
- 2026江西赣州市定南县总工会招聘见习人员9人笔试参考题库及答案详解
- 2026浙江绍兴市上虞区公共文化服务中心招聘编外用工1人备考题库及完整答案详解1套
- 2026四川省版权协会拟招聘工作人员2人备考题库及一套完整答案详解
- 2026四川成都九洲迪飞科技有限责任公司招聘六性工程师1人备考题库及1套参考答案详解
- 2026重庆渝中职业教育中心综合高中教师招聘3人备考题库附答案详解
- 2026山东省华工建筑集团有限公司招聘8人备考题库带答案详解
- 2026浙江金华武义供销农产品有限公司招聘1人备考题库有答案详解
- 2026天津宁河区公益性岗位招聘6人备考题库参考答案详解
- 2026浙江杭州市富阳区常绿镇专职网格员空缺岗位补招1人笔试模拟试题及答案详解
- 2026春苏教版六年级下册数学期末综合练习卷含答案(三套)
- 2026年安徽省体育彩票管理中心编外聘用人员公开招聘11名考试参考试题及答案解析
- 智联招聘国企笔试题库2026年答案
- 超龄劳动者用工协议
- 收获成长季:总结反思与进步小学主题班会课件
- 妇产科产后出血多学科协作
- 2025年中石油职称政治理论水平考试历年参考题库(含答案详解)
- 2026年高考(湖北卷)生物试题及答案
- 2026年高考地理一轮复习:40个高频考点答题模板汇编
- 麻醉药物不良反应处理指南
- 2025河南郑州航空港科创投资集团社会招聘40人笔试历年备考题库附带答案详解
评论
0/150
提交评论