       h_fov = Math.atan( Math.tan(v_fov/2) * @camera.aspect )
 
       return -(height / 2) / Math.tan(h_fov) * distance_scale
-
-
 
   getWordIndex = (line, word) ->
     expression = if word is "—" then word else "\\b#{word}\\b"

    end = begin + word.length
    # console.log begin, end
    text_object.children.slice begin, end

  chainedFadeIn: (array, duration) ->
    reduction = (promise, curr, index, array) =>
      promise.then =>
        @fadeToArray(1, 1000) curr._text_object.children

    promise = array.reduce reduction, Promise.resolve()

class LinesVis extends Main
  lineSpacing: 40


  wait: (duration) =>
    return new Promise (resolve) =>
      setTimeout(resolve, duration * @speedMultiplier)

  zoomCameraToPosition: (target, duration) =>
    new Promise (resolve) =>
      d3.transition()
        .duration duration * @speedMultiplier
        .tween "zoomCamera", =>
          current = @camera.position
          z = d3.interpolate current.z, target.z
