圆环opengl不会收敛

时间:2017-06-16 12:18:38

标签: python opengl graphics

在Opengl中我的Torus有问题。

这是我在Python上的代码:

global numc, numt, r

twopi = 2 * math.pi

for i in range(0, numc):
    for j in range(0, numt):
        k = 1
        while k >= 0:
            s = (i + k) % numc + 0.5
            t = j % numt

            x = (1 + r * math.cos(s * twopi / numc)) * math.cos(t * twopi / numt)
            y = (1 + r * math.cos(s * twopi / numc)) * math.sin(t * twopi / numt)
            z = r * math.sin(s * twopi / numc)
            Colors_torus.extend([1.0, 0.0, 0.0])
            Torus.extend([x, y, z])
            k -= 1

On the screen below on the right side you may observe that the circles do not converge.

0 个答案:

没有答案