我该如何实现纹理映射在OpenGL汽缸? [英] How do I texture map a cylinder in OpenGL?

查看:110
本文介绍了我该如何实现纹理映射在OpenGL汽缸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道该怎么做四边形,那是pretty的直观与U,V纹理坐标,但我有一个很难搞清楚了这一点。任何帮助是AP preciated。

I know how to do quads and that was pretty intuitive with the u,v texture coordinates but I'm having a hard time figuring this out. Any help is appreciated.

推荐答案

试想一个圆柱体的参数重新presentation

Try to think about the parametric representation of a cylinder

cylinder(u, v):
    x = r * cos(u * 2*pi)
    y = r * sin(u * 2*pi)
    z = v

U v 正是那些你为纹理坐标使用的值。

u and v are exactly those values you'd use as texture coordinates.

这篇关于我该如何实现纹理映射在OpenGL汽缸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆