 
       # Calulate the x coordinate so that the vector from the camera to the cube's middle point is
       # perpendicular to the vector going from (0, b[1], 0) to (b[0], 0, 0).
-      to = {  x: pos[0] + b[1] / diagonal, y: pos[1] + b[0] / diagonal, z: pos[2] - 1 / 2, upX: 0, upY: 0, upZ: -1, l: -distance - padding, r: diagonal - distance + padding, t: diagonal / 2 + padding + yOffset, b: -diagonal / 2 - padding + yOffset }
+      to = {
+        dx: b[1] / diagonal
+        dy: b[0] / diagonal
+        dz:- 1 / 2
+        upX: 0, upY: 0, upZ: -1
+        l: -distance - padding
+        r: diagonal - distance + padding
+        t: diagonal / 2 + padding + yOffset
+        b: -diagonal / 2 - padding + yOffset }
     else
       ind = Dimensions.getIndices(id)
       width = Math.max(b[ind[0]], b[ind[1]] * 1.12) * 1.1

      .onUpdate(@updateCameraPrev)
      .start()
    else
      to.camera = camera
      to.flycam = @flycam
      to.notify = notify
      @updateCameraPrev.call(to)

  degToRad : (deg) -> deg/180*Math.PI

  changePrevSV : (animate = true) => @changePrev(constants.VIEW_3D, animate)

  updateCameraPrev : ->
    p = @getConvertedPosition()
    @camera.position.set(@dx + p[0], @dy + p[1], @dz + p[2])
    @camera.left = @l
    @camera.right = @r
    @camera.top = @t
