螺线,通俗来说就是绕圈圈的曲线.在前面我写过一些关于二维螺线的章节,这一节中讲三维螺线.其实二维转三维只要再其添加一维数据即可.新一维数据的生成方式多种多样,可以让螺线帖在球面上,帖在圆锥面上,贴在柱面上,帖在抛物线曲面上.这样一来,三维螺线种类是二维螺线的N倍.这里,我只以阿基米德螺线为例,将其分别帖到球面,柱面,圆锥,抛物面上.
(1)球螺线
前面的章节中我还写过一个,这就是球螺线
vertices = 3600w = from 0 to 32a = mod(w, 1) * 2 * PIb = from 0 to PIr = 10.0x = r*sin(a)*sin(b)y = r*cos(a)*sin(b)z = r*cos(b)
(2)圆柱螺线
vertices = 32000t = from 0 to (2*PI)w = rand_int2(2, 32)a = rand2(1, 10)b = rand2(1, 10)c = rand2(1, 10)x = a*cos(w*t)z = b*sin(w*t)y = c*t
(3)圆锥螺线
vertices = 32000t = from 0 to (2*PI)w = rand_int2(2, 32)a = rand2(1, 10)b = rand2(1, 10)c = rand2(1, 10)x = a*t*cos(w*t)z = b*t*sin(w*t)y = c*t
vertices = 32000t = from 0 to (2*PI)w = rand_int2(2, 32)a = rand2(1, 10)b = rand2(1, 10)c = rand2(1, 10)x = a*t*cos(w*t)z = b*t*sin(w*t)y = c*t*t