OpenGL ES 正反面设置指令
在OpenGL ES 中,仅有一种表面网格表示方式,那就是三角形。
三角形的三个顶点,可以组几个面?有答 1 的没有?有!那就是还不懂OpenGL ES 的我。
事实上,一张纸是有正反面的,那么一个三角形也应该有两个面,那么在空间中,如何区分呢?那就是正反面。
那具体哪个是正面,哪个是反面呢,据说是默认逆时针是正面,顺时针是反面,不过到现在还没搞清楚,这个顺和逆是个怎么看法,我们只知道在两个轴组成的二维平面坐标系中的顺和逆。
有知道的朋友不妨给予指出,谢谢。
不过,从下面的官方资料中,不难看出,应该是空间三角形的顶点向窗口坐标系做投影,得到的投影点,在一个二维坐标系中,就可以按二维坐标系中的顺逆来考虑了。
先前,我一直考虑可能有个三维的知识点没有掌握,现在看来,还是要转成二维的来考虑。
在研究三维的过程中,很多问题都要结合着二维来考虑,就比较顺畅了。
上面说了,系统默认是逆时针是正面,那么顺时针就是反面了,如果想对调一下呢,那就得用下面的指令了 glFrontFace 。
Name
glFrontFace — 定义多边形的正面和背面 define front- and back-facing polygons
C Specification
void glFrontFace( |
GLenum mode); |
Parameters
-
mode -
指定多边形正面的方向。可授受
GL_CW和GL_CCW 两个参数。初始值是 GL_CCW。 -
Specifies the orientation of front-facing polygons.
GL_CWandGL_CCWare accepted. The initial value isGL_CCW.
描述 Description
在一个完全由不透明的封闭表面组成的场景中,多边形的背面永远也看不到。忽略这些不可见的多边形对于提升图片的渲染速度有明显的好处。要启用或禁用多边形背面消除特性,可调用 glEnable 和 glDisable 并带参数 GL_CULL_FACE。
如果一个假想的对象沿着它的第一个顶点、第二个顶点......直到最后一个顶点这样的路径,最后返回到第一个顶点,它围绕多边形本身按顺时针方向移动的,那么这个多边形映射到窗口坐标系的投影可以说成具有顺时针绕向。如果按同样的路径是以反时针方向绕多边形自身移动的,那么多边形的绕向就说成是反时针绕向。glFrontFace指定多边形在窗口坐标系中是顺时针绕向或反时针绕向作为正面;GL_CW 选择顺时针多边形作为正面。默认,反时针多边形被当作正面。
In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible polygons has the obvious benefit of speeding up the rendering of the image. To enable and disable elimination of back-facing polygons, call glEnable and glDisable with argument GL_CULL_FACE.
The projection of a polygon to window coordinates is said to have clockwise winding if an imaginary object following the path from its first vertex, its second vertex, and so on, to its last vertex, and finally back to its first vertex, moves in a clockwise direction about the interior of the polygon. The polygon's winding is said to be counterclockwise if the imaginary object following the same path moves in a counterclockwise direction about the interior of the polygon. glFrontFace specifies whether polygons with clockwise winding in window coordinates, or counterclockwise winding in window coordinates, are taken to be front-facing. Passing GL_CCW to mode selects counterclockwise polygons as front-facing; GL_CW selects clockwise polygons as front-facing. By default, counterclockwise polygons are taken to be front-facing.
错误信息 Errors
如果 mode 不是可接受的值,就会产生 GL_INVALID_ENUM 错误。
GL_INVALID_ENUM is generated if mode is not an accepted value.
Associated Gets
glGet with argument GL_FRONT_FACE
See Also
Copyright
Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.
OpenGL ES 正反面设置指令的更多相关文章
- OpenGL ES 如何能看到一个物体内部和象3dmax中能只显示网格线
上一篇 OpenGL ES 正反面设置指令 中分析了正反面的判区方法,那么正反面有什么用呢?接下来我们就要引入一个叫做背面消除的概念.在3dmax中有个选项,当你用挤压修改器挤出一个中空的长方体时,在 ...
- OpenGL ES 简单教程
什么是OpenGL ES? OpenGL ES (为OpenGL for Embedded System的缩写) 为适用于嵌入式系统的一个免费二维和三维图形库. 为桌面版本号OpenGL 的一个子集. ...
- 3D OpenGL ES
什么是OpenGL ES? OpenGL ES (为OpenGL for Embedded System的缩写) 为适用于嵌入式系统的一个免费二维和三维图形库. 为桌面版本OpenGL 的一个子集. ...
- OpenGL ES: (5) OpenGL的基本概念、OpenGL ES 在屏幕产生图片的过程、OpenGL管线(pipeline)
一. OpenGL的基本概念 OpenGL 的结构可以从逻辑上划分为下面 3 个部分: 图元(Primitives) 缓冲区(Buffers) 光栅化(Rasterize) 图元(Primitives ...
- Android OpenGL ES(十三)通用的矩阵变换指令 .
Android OpenGL ES 对于不同坐标系下坐标变换,大都使用矩阵运算的方法来定义和实现的.这里介绍对应指定的坐标系(比如viewmodel, projection或是viewport) An ...
- WebGL 在 OpenGL ES 指令 iOS 在 C 分歧版指令分析
WebGL 中 OpenGL ES 指令与 iOS 中 C 版指令的差异简析 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途 ...
- VMware Workstation 12 OpenGL ES版本支持情况与设置
概述 开始学习Opengl时,发现VMware Workstation虚拟机无法运行Opengl ES2.0的程序.后来,经过查找最终得知,是因为VMware Workstation11及之前的版本对 ...
- Android OpenGL ES 开发教程 从入门到精通
感谢,摘自:http://blog.csdn.net/mapdigit/article/details/7526556 Android OpenGL ES 简明开发教程 Android OpenGL ...
- Android OpenGL ES(五)GLSurfaceView .
Android OpenGL ES 相关的包主要定义在 javax.microedition.khronos.opengles GL 绘图指令 javax.microedition.khrono ...
随机推荐
- MySQL mysqlimport 从txt文件中导入数据到mysql数据库
mysqlimport: 我说这个我们还是先从世界观方法论的高度来理解一下便有更加准确的把握.数据导入不外呼有两个部分 第一部分:目标对象--我们要把数据导给谁(mysqlimport 的目标对象自然 ...
- mobile web 手机开发
1. -webkit-tap-highlight-color -webkit-tap-highlight-color:rgba(255,255,255,0); 用来把android上点击网页时出现 ...
- jasmine官方api参考
jasmine 简介 jasmine 是一个行为驱动开发(TDD)测试框架, 一个js测试框架,它不依赖于浏览器.dom或其他js框架 jasmine有十分简介的语法 使用 从 这里 下载 stant ...
- CDialogSK - A Skinnable Dialog Class
Introduction This class is derived from the MFC CDialog. It supports the following features :- If ru ...
- 160G 视频教程(Java+Android+项目视频)免费下载
我不喜欢多说没用,直接给下载链接,进去直接下载,下载不动的联系网站客服解决!我只和我的好朋友们分享好的视频教程 http://edu.csdn.net/main/video.shtml 视频教程目录过 ...
- STC15?MSP430?ARM?DSP?
自从大学毕业以来,发现属于自己的时间越来越少,每天忙于工作,导致在大学学到的东西都好生疏,特别是大一刚开始学的模电,单片机等,现在才慢慢的抓起来,然后在这个多核处理器流行的时代,单片机貌似快过时了,但 ...
- Android开发_SQLite使用方法技巧
SQLite介绍 SQLite是轻量级的.嵌入式的.关系型数据库,目前已经在iPhone.Android等手机系统中使用,SQLite可移植性好,很容易使用,很小,高效而且可靠.SQLite嵌入到使用 ...
- android 视频播放器的INTENT-FILTER属性
<intent-filter> <action android:name="android.intent.action.VIEW&quo ...
- BZOJ 1668: [Usaco2006 Oct]Cow Pie Treasures 馅饼里的财富( dp )
dp , dp[ i ][ j ] = max( dp[ k ][ j - 1 ] ) + G[ i ][ j ] ( i - 1 <= k <= i + 1 , dp[ k ][ j - ...
- BZOJ 1601: [Usaco2008 Oct]灌水( MST )
MST , kruskal 直接跑 ---------------------------------------------------------------------- #include< ...