程序球体纹理
我目前正在遵循有关创建程序球体的程序教程 在这里,我尝试将其与纹理教程合并,以创建找到的地球的 3D 版本 此处。
到目前为止,我已经能够成功地将纹理绑定到球体上。但是,我在显示方式上遇到了一些问题。我已将链接附加到屏幕截图以进一步显示结果。正如您所看到的,图像是重复的,并且没有完全包裹在球体上。
我正在使用这段代码,我猜这可能会导致问题:
glTexCoordPointer(3, GL_FLOAT, 0, sphereTriangleStripVertices);
我希望你能帮助我这是因为我几周来一直在努力解决这个问题。
预先非常感谢您。
I am currently following the procedural tutorial on creating procedural spheres found here and I am trying to merge it with the textures tutorial with it to create a 3d version of Earth found here.
So far, I was able to successfully bind the texture on the sphere. However, I am having some problems with the way it was displayed. I have attached links to the screen captures to further show the result. As you can see, the image is repeated and is not entirely wrapped on the sphere.
I am using this code, which I am guessing might cause the problem:
glTexCoordPointer(3, GL_FLOAT, 0, sphereTriangleStripVertices);
I hope you can help me with this as I have been trying to fix this for weeks now.
Thank you very much in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您应该使用“glTexCoordPointer(2 ...”而不是“glTexCoordPointer(3...”),因为几乎可以肯定每个坐标都有两个值。
I believe you should have "glTexCoordPointer(2 ..." instead of "glTexCoordPointer(3..." as you must almost certainly have two values for each coordinate.