如何在OpenGL中创建带有三角形的均匀球体? [英] How to create an even sphere with triangles in OpenGL?

查看:175
本文介绍了如何在OpenGL中创建带有三角形的均匀球体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个公式可以生成一组顶点位于球体上的三角形坐标?

Is there a formula that generates a set of coordinates of triangles whose vertices are located on a sphere?

我可能正在寻找与gluSphere类似的功能.但是,我需要用特定的颜色给不同的三角形上色,这样看来我不能使用gluSphere.

I am probably looking for something that does something similar to gluSphere. Yet, I need to color the different triangles in specfic colors so that it seems I can't use gluSphere.

此外:我确实理解gluSphere沿着具有相同经度和纬度的线绘制边缘,这使得三角形的两极与赤道上的三角形相比较小.现在,如果这样的公式生成三角形,以使它们的大小差异最小化,那就太好了.

Also: I do understand that gluSphere draws edges along lines with equal longitudes and lattitudes which entails the triangles being small at the poles compared to their size at the equator. Now, if such a formula would generate the triangles such that their difference in size is minimized, that would be great.

推荐答案

从单元二十面体开始.然后应用三角形的多重均质细分,将所得顶点到原点的距离归一化.

Start with a unit icosahedron. Then apply muliple homogenous subdivisions of the triangles, normalizing the resulting vertices distance to the origin.

这篇关于如何在OpenGL中创建带有三角形的均匀球体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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