||
(张学文注因为我新建了环科学初探这个子目录,这里把邱嘉文曾经(2012年)为我特意做的三维环面的图转帖到这里,再次谢谢邱嘉文博主)
|||
蓝色可以表示冬季,绿色表示春季,黄色表示夏季,红色表示秋季。
再上几张图:
从正顶向下看:
从侧下向上看
进到胎里面看:
附:
环面构造的图形学算法。其实,就是根据环面的参数方程算出每点的(x,y,z)。
u = 6.28
For u = 0 To 6.28 Step du
For v = 0 To 6.28 Step dv
xx = (100# + r * Cos(u)) * Cos(v)
yy = (100# + r * Cos(u)) * Sin(v)
zz = 100# + r * Sin(u)
x1 = xx * Cos(cy) + zz * Sin(cy) + 200
y1 = xx * Sin(cy) * Sin(cx) + yy * Cos(cx) _
- zz * Cos(cy) * Sin(cx) + 200
z1 = -xx * Sin(cy) * Cos(cx) + yy * Sin(cx) _
+ zz * Cos(cy) * Cos(cx)
xx = (100# + r * Cos(u)) * Cos(v + dv)
yy = (100# + r * Cos(u)) * Sin(v + dv)
zz = 100# + r * Sin(u)
x2 = xx * Cos(cy) + zz * Sin(cy) + 200
y2 = xx * Sin(cy) * Sin(cx) + yy * Cos(cx) - _
zz * Cos(cy) * Sin(cx) + 200
z2 = -xx * Sin(cy) * Cos(cx) + yy * Sin(cx) + _
zz * Cos(cy) * Cos(cx)
xx = (100# + r * Cos(u + du)) * Cos(v + dv)
yy = (100# + r * Cos(u + du)) * Sin(v + dv)
zz = 100# + r * Sin(u + du)
x3 = xx * Cos(cy) + zz * Sin(cy) + 200
y3 = xx * Sin(cy) * Sin(cx) + yy * Cos(cx) - _
zz * Cos(cy) * Sin(cx) + 200
z3 = -xx * Sin(cy) * Cos(cx) + yy * Sin(cx) + _
zz * Cos(cy) * Cos(cx)
xx = (100# + r * Cos(u + du)) * Cos(v)
yy = (100# + r * Cos(u + du)) * Sin(v)
zz = 100# + r * Sin(u + du)
x4 = xx * Cos(cy) + zz * Sin(cy) + 200
y4 = xx * Sin(cy) * Sin(cx) + yy * Cos(cx) - _
zz * Cos(cy) * Sin(cx) + 200
z4 = -xx * Sin(cy) * Cos(cx) + yy * Sin(cx) + _
zz * Cos(cy) * Cos(cx)
xx1 = x2 - x1: xx2 = x3 - x1
yy1 = y2 - y1: yy2 = y3 - y1
zz1 = z2 - z1: zz2 = z3 - z1
x = yy1 * zz2 - yy2 * zz1
y = zz1 * xx2 - zz2 * xx1
z = xx1 * yy2 - xx2 * yy1
If (z > 0) Then
xd(0) = x1: yd(0) = y1
xd(1) = x2: yd(1) = y2
xd(2) = x3: yd(2) = y3
xd(3) = x4: yd(3) = y4
dd = -(x * x1 + y * y1 + z * z1)
Call tc(4, 100) //不要管这句,这句是调用光照渲染算法的。
End If
Next
Next
End Sub
转载本文请联系原作者获取授权,同时请注明本文来自邱嘉文科学网博客。
链接地址:https://blog.sciencenet.cn/blog-33982-562711.html
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-28 13:35
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社