在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.