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

最新文章

  1. 用递归调用实现字符串反转(java版)
  2. hibernate id 策略
  3. CentOS 6.5/6.6 安装(install)mysql 5.7 最完整版教程
  4. 新手指导:教你如何查看识别hadoop是32位还是64位
  5. Windows 2008 server R2安装.NET Framework4时提示“灾难性故障”解决
  6. C/C++中字符串存储位置
  7. Nutch的日志系统
  8. 安卓系统浏览器中select下拉按钮无法弹出选择面板奇怪问题解决
  9. Webpack 资源管理
  10. linux安装oracle笔记
  11. 单双通道对RTX有何影响?结果出乎意料
  12. Hadoop学习笔记(六):hive使用
  13. tail -f -n 0 /var/log/messages
  14. Android Studio编译OsmAnd出现警告:GeoPointParserUtil.java使用或覆盖了已过时的 API。有关详细信息请使用-Xlint:deprecation重新编译
  15. 详解Zookeeper原理与应用场景
  16. MyBatis 对数据库进行CRUD操作
  17. QeePHP View视图的默认变量与新增变量
  18. 浮动闭合最佳方案:clearfix
  19. Netty权威指南之Netty入门程序
  20. android开发 gradle 总结

热门文章

  1. LeetCode 430. Flatten a Multilevel Doubly Linked List
  2. 在线编辑器KindEditor的使用
  3. cmd连接mysql操作命令
  4. fatal: The remote end hung up unexpectedly解决办法
  5. java指定文件编码格式
  6. 记一次socket_create()函数耗时异常记录
  7. jeecg中List页面的高级查询
  8. 设计WEB数据库(学习)
  9. Java基础--NIO
  10. hadoop Partiton中的字符串Hash函数改进