 
 prevTime = null
 stepsLeft = 0
-stepsPerMs = 5 / 1000
+stepsPerMs = 15 / 1000
 
 animate = ->
   requestAnimationFrame animate

      pushXYZ x,y+yn2,z+zn2
      pushXYZ x+xn1,y,z+zn1
      pushXYZ x,y-yn2,z-zn2
      if iz >0
        for j in [0...4]
          j1 = (j+1)%4
          pushQuad vindex-4+j, vindex+j, vindex-4+j1, vindex+j1

    if curIx isnt ixs.length then throw new Error "Not all indices filled"
    if curV isnt vs.length then throw new Error "Not all vertices filled"

    tube = new THREE.BufferGeometry()



  createTube: (xys, i, xy0)->
    jumpTreshold = @jumpTreshold
    vs = new Float32Array xys.length*4*3 #x,y,z; 4 vertices
    ixs =  new Uint16Array (xys.length-1)*2*3*4 #2 triangles
    curIx = 0
