only splines build in runtime
#constant SPLINE_MAX 50
#constant SPLINE_DIST 1500
sync rate 60 : sync on : color backdrop -1 : ink 0, 0
make object triangle 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
color object 1, 255
set object wireframe 1, 1
make mesh from object 1, 1
SetSplineVectors(SPLINE_MAX, SPLINE_DIST)
do
if timer() > time and step# < 1.000
for vector = 1 to 5 * SPLINE_MAX step 5
SplineDraw(vector, step#)
next vector
step# = step# + 0.01
time = timer() + 30
endif
set camera to follow 0, 0, 0, angle#, 500, sin(angle#) * 100, 1.0, 0
point camera 0, 0, 0
angle# = angle# + 0.5
set cursor 0,0
print screen fps()
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