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. check sub-string in the string

    if "blah" not in somestring: continue

  2. Quick 3.3 的代码资源加密

    http://cn.cocos2d-x.org/tutorial/show?id=1507 http://cn.cocos2d-x.org/tutorial/show?id=1447 http://b ...

  3. qqbot 配置

    qqbot 配置 用起来还是挺方便的,使用 pip install qqbot 就可以. 不过找配置文件没注意,以为是在程序目前,原来是在 C:\Users\xxx.qqbot-tmp 目录. 插件可 ...

  4. Face detection in color images, 彩色图像中的人脸检测

    人脸检测在视频监督,人机交互,人脸识别和人脸图像数据库管理等应用领域处于很重要的地位. 论文<Face detection in color images>中给出一种在YCbCr空间检测人 ...

  5. laravel的中间件demo

    过滤器已经被废除...刚学才两天,蛋疼 创建一个中间件 ./artisan make:middleware TestMiddleware 大概代码 <?php namespace App\Htt ...

  6. 谈谈GPU与FPGA的一些看法

    从几个方面来介绍一下GPU和FPGA. 从峰值性能来说,GPU(10Tflops)远远高于FPGA(<1TFlops).GPU上面成千上万个core同时跑在GHz的频率上还是非常壮观的,最新的G ...

  7. 使用apache common-io 监控文件变化

    package common.io; import org.apache.commons.io.filefilter.FileFilterUtils; import org.apache.common ...

  8. ALSA声卡笔记1---ALSA驱动框架

    1.声卡驱动程序sound.c (1)入口函数里通过register_chrdev()函数注册file_operations 结构体 (2)file_operations 结构体,里面只有open函数 ...

  9. linux oracle服务器无密码登录dba

    1.su - oracle 切换到oracle 2.sqlplus sys/manger as sysdba 3.新建用户: create user username identified by pa ...

  10. Core Java (十一) Java 继承,类,超类和子类

    Core Java (十一) Java 继承,类,超类和子类 标签: javaJavaJAVA 2013-01-22 17:08 1274人阅读 评论(0) 收藏 举报  分类: java(58) 读 ...