




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
OPENGL ES中几个重要函数详细说明时间: 2010-04-30 14:47 点击: 2012 次函数名:glVertexPointer void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) Parameters size Specifies the number of coordinates per vertex. Must be 2, 3, or 4. The initial value is 4. type Specifies the 函数名:glVertexPointervoid glVertexPointer(GLint size,GLenum type,GLsizei stride,const GLvoid * pointer)Parameterssize Specifies the number of coordinates per vertex. Must be 2, 3, or 4. Theinitial value is 4.type Specifies the data type of each vertex coordinate in the array. Symbolicconstants GL_BYTE, GL_SHORT, and GL_FIXED, are accepted. However, theinitial value is GL FLOAT.The common profile accepts the symbolic constant GL FLOAT as well.stride Specifies the byte offset between consecutive vertices. If stride is 0, thevertices are understood to be tightly packed in the array. The initial valueis 0.pointer Specifies a pointer to the first coordinate of the first vertex in the array.The initial value is 0.参数:size:指定了每个顶点对应的坐标个数,只能是2,3,4中的一个,默认值是4type:指定了数组中每个顶点坐标的数据类 型,可取常量:GL_BYTE, GL_SHORT,GL_FIXED,GL_FLOAT;stride:指定了连续顶点间的字节排列方式,如果为0,数组中的顶点就会被认为是按照紧凑方式排列的,默认值为0pointer:制订了数组中第一个顶点的首地址,默认值为0,对于我们的android,大家可以不 用去管什么地址的,一般给一个IntBuffer就可以了。DescriptionglVertexPointer specifies the location and data of an array of vertex coordinatesto use when rendering. size specifies the number of coordinates per vertex and typethe data type of the coordinates. stride specifies the byte stride from one vertex tothe next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations.)When a vertex array is specified, size, type, stride, and pointer are saved asclient-side state.If the vertex array is enabled, it is used when glDrawArrays, or glDrawElementsis called. To enable and disable the vertex array, call glEnableClientStateand glDisableClientState with the argument GL VERTEX ARRAY. The vertex arrayis initially disabled and isnt accessed when glDrawArrays or glDrawElements iscalled.Use glDrawArrays to construct a sequence of primitives (all of the same type)from prespecified vertex and vertex attribute arrays. Use glDrawElements to constructa sequence of primitives by indexing vertices and vertex attributes.If the vertex array is enabled, it is used when glDrawArrays, or glDrawElementsis called. To enable and disable the vertex array, call glEnableClientStateand glDisableClientState with the argument GL_VERTEX ARRAY. The vertex arrayis initially disabled and isnt accessed when glDrawArrays or glDrawElements iscalled.Use glDrawArrays to construct a sequence of primitives (all of the same type)from prespecified vertex and vertex attribute arrays. Use glDrawElements to constructa sequence of primitives by indexing vertices and vertex attributes描述:当开始render的时候,glVertexPointer 用一个数组指定了每个顶点的坐标,size指定了每个顶点的坐标个数type指定了每个坐标的数据类型,(和尚注:注意,这里不同的数据类型含义不同,如果选择GL_FIXED,那么0x10000表示单位长度,如果选择 GL_FLOAT那么1.0f表示单位度。)stride指定了一个顶点和下一个顶点间数据的排列方式,是单一数组还是分散数 组,单一数组的存储方式通常是更具效率的。当一个顶点数组被指定以后,size,type,stride,pointer被存储成client- side.当glDrawArrays或者glDrawElements被调用的时候,如果顶点数组 处于可用状态, 就会被使用;可以使用glEnableClientState或者glDisableClientState来激活或者禁用一个顶点数组,顶点数组默认是 不可用并且是不可被glDrawArrays、glDrawElements两个函数使用的。使用glDrawArrays函数可以根据顶点数组构建一个原始构图序列使用glDrawElements可以根据序列化的顶点集合来创建相同的序列NotesglVertexPointer is typically implemented on the client sideErrorsGL_INVALID_VALUE is generated if size is not 2, 3, or 4.GL_INVALID_ENUM is generated if type is is not an accepted value.GL_INVALID_VALUE is generated if stride is negative.错误:GL_INVALID_VALUEsize 不是 2, 3, 4中的一个的时候GL_INVALID_ENUM type 不是一个允许的值.GL_INVALID_VALUEstride是错误的函数名:glDrawArrays 从数组提供原始数据void glDrawArrays(GLenum mode, GLint first, GLsizei count)Parametersmode Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP,GL_TRIANGLE_FAN, and GL_TRIANGLES are accepted.first Specifies the starting index in the enabled arrays.count Specifies the number of indices to be rendered.参数:mode指定要提供的原始图形的样式,比如:GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP,GL_TRIANGLE_FAN, GL_TRIANGLESfirst 指定了被激活的数组的索引起始点,通常为0count 取几个数,和first配合使用DescriptionglDrawArrays specifies multiple geometric primitives with very few subroutine calls.You can prespecify separate arrays of vertices, normals, colors, and texture coordinatesand use them to construct a sequence of primitives with a single call to glDrawArrays.When glDrawArrays is called, it usessequential elements from each enabledarray to construct a sequence of geometric primitives, beginning with elementfirst. mode specifies what kind of primitives are constructed, and how the array elementsconstruct those primitives. If GL_VERTEX_ARRAY is not enabled, no geometricprimitives are generated.Vertex attributes that are modified by glDrawArrays have an unspecified valueafter glDrawArrays returns. For example, if GL_COLOR_ARRAY is enabled, the value ofthe current color is undefined after glDrawArrays executes. Attributes that arentmodified remain well defined.描述:glDrawArrays 提供了多种基本几何样式的绘制,你可以对各种数组,比如说顶点、颜色、材质的坐标进行分割(和尚注:通过first和count参数),并且使用这些分割 出来的坐标来构造一个显示队列。当glDrawArrays 被调用的时候,它会从first参数开始,按照mode指定的样式,按照顺序使用被激活的数组中的每个元素去构造一个由基本几何单元构成的队列,如果 GL_VERTEX_ARRAY没有处于激活状态,不会有任何几何单元被创建。在glDrawArrays 被返回后,被这个函数编辑的顶点的属性将成为一个不确定的值,例如:glDrawArrays 函数被调用以后,当前颜色将会变成一个未定义的 值。没有被函数引用的顶点属性会保留与原本的属性。(和尚注:很绕口,关于这一小段的翻译,我反复修改了很多遍,意思其实很简单,如果一个顶点数组被 glDrawArrays使用,那么使用后这些顶点决定的那个几何图形的属性,比如颜色,就会丢失,不会影响到下一个glDrawArrays 的绘制,因此当你要重新用glDrawArrays 绘制一个顶点集合的话,就要重新用glColor4f来设定颜色)ErrorsGL_INVALID_ENUM is generated if mode is not an accepted value.GL_INVALID_VALUE is generated if count is negative.错误:GL_INVALID_ENUMmode不是一个被允许的值GL_INVALID_VALUEcount不合法函数名:glTranslatef, glTranslatex multiply the current matrix by a translation matrixC Specificationvoid glTranslatef(GLfloat x, GLfloat y, GLfloat z)void glTranslatex(GLfixed x, GLfixed y, GLfixed z)名称:glTranslatef, glTranslatex在一个副本(和尚:不知道翻译成副本合适不合适)模型上确定一个基于某个增量的新原点(和尚注:自己明白,要想写出合适的译 文真的好难)函数名:glVertexPointer void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) Parameters size Specifies the number of coordinates per vertex. Must be 2, 3, or 4. The initial value is 4. type Specifies the void glTranslatef(GLfloat x, GLfloat y, GLfloat z)void glTranslatex(GLfixed x, GLfixed y, GLfixed z)Parametersx, y, z Specify the x, y, and z coordinates of a translation vector.参数:x,y,z指定了一个基于某个方向的x,y,z坐标DescriptionglTranslate produces a translation by (x, y, z). The current matrix (see glMatrixMode)is multiplied by this translation matrix, with the product replacing thecurrent matrix, as if glMultMatrix were called with the following matrix for itsargument:1 0 0 x0 1 0 y0 0 1 z0 0 0 1If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all objects drawn aftera call to glTranslate are translated.Use glPushMatrix and glPopMatrix to save and restore the untranslated coordinatesystem.描述:glTranslate 根据x,y,z生成了一个副本模型,当前模型是一个基于此模型的增量模型,glMultMatrix 被调用的时候用以下模型来做参数:1 0 0 x0 1 0 y0 0 1 z0 0 0 1如果模型模式是either GL_MODELVIEW 或者 GL_PROJECTION,所有的对象都会在glTranslate 被调用以后绘制使用glPushMatrix 和 glPopMatrix来保存和恢复未被副本化的坐标系统(和尚注:每一个层都是基于自己的坐标系统的,关于x,y,z的含义,参看以下说明:OpenGL屏幕中 心的坐标值是X和Y轴上的0.0f点。中心左面的坐标值是负值,右面是正值。移向屏幕顶端是正值,移向屏幕底端是负值。移入屏幕深处是负值,移出屏幕则是正值。 )。函数名:glClear clear buffers to preset valuesC Specificationvoid glClear(GLbitfield mask)名称glClear 为重设数据清空缓冲区void glClear(GLbitfield mask)Parametersmask Bitwise OR of masks that indicate the buffers to be cleared.Valid masks are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT.参数:掩码: 用OR连接起来的掩码,这些掩码决定了哪些缓冲区将被清除,可用的掩码有:GL_COLOR_BUFFER_BITGL_DEPTH_BUFFER_BITGL_STENCIL_BUFFER_BITDescriptionglClear sets the bitplane area of the window to values previously selected by gl-ClearColor, glClearDepth, and glClearStencil.The pixel ownership test, the scissor test, dithering, and the color buffer masksaffect the operation of glClear. The scissor box bounds the cleared region. Alphafunction, blend function, logical operation, stenciling, texture mapping, and depthbufferingare ignored by glClear.glClear takes a single argument that is the bitwise OR of several values indicatingwhich buffer is to be cleared.The values are as follows:GL COLOR BUFFER BITIndicates the color buffer.GL DEPTH BUFFER BITIndicates the depth buffer.GL STENCIL BUFFER BITIndicates the stencil buffer.The value to which each buffer is cleared depends on the setting of the clear valuefor that buffer.描述:glClear把窗口的bitplane区域的值设置成 您设置的ClearColor, glClearDepth, glClearStencilownership测试、切图测试、抖动、颜色缓冲掩码受glClear的影响(空白区域的盒子跳动)Alpha通道函数,混合函数,逻辑操作,模板操 作,纹理材质操作,深度缓冲区操作将被glClear忽略。glClear的参数用几个OR连接3个可选项来制定要清楚哪些缓冲区关于可选项的说明:GL COLOR BUFFER BIT颜色缓冲区GL DEPTH BUFFER BIT深度缓冲区GL STENCIL BUFFER BIT模板缓冲区函数名:glMatrixMode specify which matrix is the current matrixC Spe
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 戒酒病人知情协议书6篇
- 单招综合模拟试题及答案
- 2025年中职团课考试试题及答案
- 供应链金融服务合作协议8篇
- 噪音护士考试试题及答案
- 2025年生产助理考试试题及答案
- 2025年口腔颌面外科口腔颌面手术护理知识考核答案及解析
- 2025年心脏病学常见心律失常临床诊断模拟考试卷答案及解析
- 2025年麻醉科药物选择与用量考核答案及解析
- 2025年实验诊断学临床检验解读考试答案及解析
- 思政家乡课件
- (2024版)小学道德与法治 一年级上册 教学设计
- 《质量管理理论方法与实践》课件-质量管理 ch5 质量功能展开
- 2025年职业培训学校建设项目可行性分析与初步设计方案报告
- 2025年软件架构师专业技术考核试题及答案解析
- 八上语文第9课《天上有颗南仁东星》课件
- 2024年BRCGS包装材料全球标准第7版全套管理手册及程序文件(可编辑)
- 公考公共基础知识培训课件
- 2025年人保非车险考试题及答案
- 铁路工程试验检测员培训考试题土工试题及答案
- 2025年上海银行笔试题库及答案
评论
0/150
提交评论