螺线,通俗来说就是绕圈圈的曲线.在前面我写过一些关于二维螺线的章节数学图形(1.12) 螺线,这一节中讲三维螺线.其实二维转三维只要再其添加一维数据即可.新一维数据的生成方式多种多样,可以让螺线帖在球面上,帖在圆锥面上,贴在柱面上,帖在抛物线曲面上.这样一来,三维螺线种类是二维螺线的N倍.这里,我只以阿基米德螺线为例,将其分别帖到球面,柱面,圆锥,抛物面上.
(1)球螺线
前面的章节中我还写过一个数学图形(2.10)绕在球上的线圈,这就是球螺线
vertices = 3600 w = from 0 to 32 a = mod(w, 1) * 2 * PI b = from 0 to PI r = 10.0 x = r*sin(a)*sin(b) y = r*cos(a)*sin(b) z = r*cos(b)
(2)圆柱螺线
vertices = 32000 t = 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 = 32000 t = 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
(4)抛物螺线
vertices = 32000 t = 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
原文:http://www.cnblogs.com/WhyEngine/p/3841003.html