码迷,mamicode.com
首页 > 其他好文 > 详细

glTexGen

时间:2014-07-23 20:48:55      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   color   strong   

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 = [ 1, 0, 0, 0 ]
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, -1, 0)
glVertex3f(-1.25, -1, 0)
glVertex3f(-1.25, 1, 0)
glVertex3f(-3.25, 1, 0)
glEnd()

  bubuko.com,布布扣

参考:http://resumbrae.com/ub/dms424_s05/10/print.html

glTexGen,布布扣,bubuko.com

glTexGen

标签:des   style   blog   http   color   strong   

原文地址:http://www.cnblogs.com/tekkaman/p/3863765.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!