pan = ({ controls, camera, speed = 1 }, delta) => {
  const unproject = require('camera-unproject')
  const { projection, view, viewport } = camera
  const combinedProjView = mat4.multiply([], projection, view)
  const invProjView = mat4.invert([], combinedProjView)

  const panStart = [
    viewport[2],
    viewport[3],
    0
  ]
  const panEnd = [
    viewport[2] - delta[0],
    viewport[3] + delta[1],
    0
  ]
  const unPanStart = unproject([], panStart, viewport, invProjView)
  const unPanEnd = unproject([], panEnd, viewport, invProjView)
  const eyeDistance = vec3.distance(camera.position, camera.eye)

  const offset = vec3.subtract([], unPanStart, unPanEnd).map((x) => x * speed * eyeDistance * controls.scale)

  return {
    controls,
    camera: {
      position: vec3.add(vec3.create(), camera.position, offset),
      target: vec3.add(vec3.create(), camera.target, offset)
    }
  }
}
compute camera state to pan the camera
@param {Object} controls the controls data/state
@param {Object} camera the camera data/state
@param {Float} delta value of the raw pan delta
@return {Object} the updated camera data/state