#constant SPLINE_MAX 100 : #constant SPLINE_DIST 500
dw = desktop width() : dh = desktop height() : set display mode dw, dh, 32, 1, 0, 0 : color backdrop 0 : sync on : sync rate 0 : autocam off : hide mouse : maximize window : make object cube 1, 0 : set object wireframe 1, 1 : set object cull 1, 0 : set object light 1, 0 : make mesh from object 1, 1
SetSplineVectors(SPLINE_MAX, SPLINE_DIST)
do
if timer() > time and step# < 1.0
for vector = 1 to 5 * SPLINE_MAX step 5 : SplineDraw(vector, step#) : next vector : step# = step# + 0.05 : time = timer() + 100 : endif
set camera to follow 0, 0, 0, angle#, 600 + sin(angle#) * 500, sin(angle#) * 500, 1.0, 0 : point camera 0, 0, 0 : angle# = angle# + 0.5
sync : loop : end
function SetSplineVectors(s, d)
for v = 1 to 5 * s step 5
for c = 0 to 4 : null = make vector3(v + c) : next c
set vector3 v, 0, 0, 0 : set vector3 v + 1, 0, 0, 0 : set vector3 v + 2, newxvalue(0, rnd(359), rnd(d)), newyvalue(0, rnd(359), rnd(d)), newzvalue(0, rnd(359), rnd(d)) : set vector3 v + 3, newxvalue(0, rnd(359), rnd(d)), newyvalue(0, rnd(359), rnd(d)), newzvalue(0, rnd(359), rnd(d)) : set vector3 v + 4, newxvalue(0, rnd(359), d), newyvalue(0, rnd(359), d), newzvalue(0, rnd(359), d)
next v
endfunction
function SplineDraw(v, s#)
x1# = x vector3(v) : y1# = y vector3(v) : z1# = z vector3(v) : hermite vector3 v, v + 1, v + 2, v + 3, v + 4, s# : x2# = x vector3(v) : y2# = y vector3(v) : z2# = z vector3(v)
lock vertexdata for limb 1, 0 : c = get vertexdata vertex count()
set vertexdata position c - 3, x1#, y1#, z1# : set vertexdata position c - 2, x2#, y2#, z2# : set vertexdata position c - 1, x2#, y2#, z2# : add mesh to vertexdata 1
unlock vertexdata
endfunction
LG
Kulle