游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1386|回复: 0

请问如何给圆柱面贴图?

[复制链接]

8

主题

13

帖子

13

积分

新手上路

Rank: 1

积分
13
发表于 2006-11-24 17:14:00 | 显示全部楼层 |阅读模式
我用下面的函数贴图,可以贴上,但是是乱屏,不知道为什么?

是不是纹理坐标生成的不对?请指教,谢谢!

glPushMatrix();
//bind the texture
glBindTexture(GL_TEXTURE_2D, m_textureObjectOne);

// draw the plane at the world origin
               
static GLUquadricObj *quadObj1;
quadObj1 = gluNewQuadric();
gluQuadricDrawStyle(quadObj1,GLU_FILL);
gluQuadricNormals(quadObj1,GL_FLAT);
gluQuadricOrientation(quadObj1,GLU_INSIDE);
gluQuadricTexture(quadObj1,GL_TRUE);
gluCylinder(quadObj1,8.0,8.0,10.0,80.0,20.0);
glPopMatrix();
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-25 23:32

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表