glTexGen

  Rather than having to explicitly provide a texture coordinate for each vertex, we can use texture coordinate generation (texgen) functions to have OpenGL automatically compute texture coordinates.

  This uses the function glTexGen, and the glEnable modes GL_TEXTURE_GEN_S & GL_TEXTURE_GEN_T.

planeCoefficients = [ , , ,  ]
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR)
glTexGenfv(GL_S, GL_OBJECT_PLANE, planeCoefficients)
glEnable(GL_TEXTURE_GEN_S) glBegin(GL_QUADS)
glVertex3f(-3.25, -, )
glVertex3f(-1.25, -, )
glVertex3f(-1.25, , )
glVertex3f(-3.25, , )
glEnd()

  

API说明

  

  coord:Specifies a texture coordinate. Must be one of GL_SGL_TGL_R, or GL_Q.

  pname:Specifies the symbolic name of the texture-coordinate generation function. Must be GL_TEXTURE_GEN_MODE.

  param:Specifies a single-valued texture generation parameter, one of GL_OBJECT_LINEARGL_EYE_LINEARGL_SPHERE_MAPGL_NORMAL_MAP, or GL_REFLECTION_MAP.

参考:

1、http://resumbrae.com/ub/dms424_s05/10/print.html

2、https://www.opengl.org/sdk/docs/man2/xhtml/glTexGen.xml

glTexGen的更多相关文章

  1. opengl纹理映射总结

    大概步骤: 1.创建纹理对象,并为他指定一个纹理. 2.确定纹理如何应用到每个像素上. 3.启用纹理贴图 4.绘制场景,提供纹理和几何坐标 过滤:由于我们提供的纹理图像很少能和最终的屏幕坐标形成对应, ...

  2. NeHe OpenGL教程 第十五课:纹理图形字

    转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...

  3. Projective Texture的原理与实现

    http://blog.csdn.net/xukunn1226/article/details/775644 Projective Texture是比较常见的一种技术,实现起来代码也就区区的不过百行, ...

  4. 【转】OpenGL基础图形编程(二)

    原文:http://blog.chinaunix.net/uid-20638550-id-1909184.html  分类: 十一.位图与图像 11.1.位图 11.1.1 位图(Bitmap)与字符 ...

  5. openGL研究钞四 : 关于颜色, 尺寸, 虚线, 多边形逆转, 空洞, 使用位图

    转载请保留源,,,,hushuai1992http://blog.csdn.net/u013642494/article/category/2675731 额. 这个标题我都不知道该怎么起了. 假设没 ...

  6. OpenGLES.Functions.Missing.in.OpenGLES1.x

    转载自: http://maniacdev.com/2009/05/big-list-of-opengl-functions-missing-in-iphone-opengl-es The funct ...

  7. OpenGl学习 glenable()函数理解

    glEnable用于启用各种功能.功能由参数决定.与glDisable相对应.glDisable是用来关闭的.两个函数参数取值是一至的. 参数说明:void glEnable(GLenum cap)G ...

  8. Qt Creator中的3D绘图及动画教程(参照NeHe)

    Qt Creator中的3D绘图及动画教程(参照NeHe) http://blog.csdn.net/cly116/article/details/47184729 刚刚学习了Qt Creator,发 ...

  9. OpenGL编程指南第九章:纹理映射

    转自://http://blog.csdn.net/longhuihu/article/details/8477614 纹理(texture)是一块矩形数据序列,存储的数据为颜色.亮度.alpha值. ...

随机推荐

  1. 通过 Windows API 获取鼠标位置等状态信息

    #include <graphics.h> #include <stdio.h> void main() { initgraph(, ); // 初始化绘图窗口 HWND hw ...

  2. 错误:Authentication with old password no longer supported, use 4.1 style passwords.

    今天重新装了系统,mysql connector 使用了官网的最新版本(6.8.3). 启动项目出现标题中的错误.原因大家谷歌. 解决方法,使用低版本的 connector. 我使用的是 6.5.6 ...

  3. 记一次 FastAdmin CMS 内容提示空的问题

    记一次 FastAdmin CMS 内容提示空的问题 有小伙伴反馈 FastAdmin CMS 安装后出现内容有文字,但提示错误 的问题. 我在本地重新安装测试并没有发现这个问题,一切正常,编辑器也可 ...

  4. Oracle instant client及pl sql developer的使用

    Oracle instant client的使用   最近重装了操作系统,使用的是Windows7 x64的版本,不准备安装Oracle,于是从官网上看到了Instant Client.   兴冲冲下 ...

  5. Java API 操作Redis

    针对Redis的Java客户端有很多种,具体查看官网信息:https://redis.io/clients#java 本次测试使用Jedis API,Jedis使用方便,其api方法名称与redis命 ...

  6. win7 + python2.7 安装scipy

    问题: 直接pip install scipy将不能正确安装,缺少文件 方法: 下载  "scipy‑0.19.0‑cp27‑cp27m‑win_amd64.whl"[90多M] ...

  7. 本地oracle的配置连接

    oraclediver_name=oracle.jdbc.driver.OracleDriverurl=jdbc:oracle:thin:@205.168.1.125:1521:orclusernam ...

  8. JAVA-Unit05: 视图、序列、索引 、 约束

    Unit05: 视图.序列.索引 . 约束 视图 数据库对象之一 视图在SQL语句中体现的角色与表相同, 但它并非一张真实存在的表,它对应的 是一个查询语句的结果集. 创建一个查看10号部门员工信息的 ...

  9. bfs判断子图是否连通

    int judge() { int v[13] = { 0 }; queue<int> myq; myq.push(ans[0]); v[ans[0]] = 1; while (!myq. ...

  10. (转)Inno Setup入门(四)——为程序创建桌面快捷方式

    本文转载自:http://blog.csdn.net/augusdi/article/details/8564810 Icons这一可选段定义所有创建在开始菜单和\或其它位置 (比如桌面) 的快捷方式 ...