 
       # 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

    time = 800
    to = {}
    notify = => @trigger("cameraPositionChanged")
    @tween = new TWEEN.Tween({ notify: notify, upX: camera.up.x, upY: camera.up.y, upZ: camera.up.z, camera: camera, flycam: @flycam,sv : @skeletonView,x: camera.position.x,y: camera.position.y,z: camera.position.z,l: camera.left,r: camera.right,t: camera.top,b: camera.bottom })
    if id == constants.VIEW_3D
      diagonal = Math.sqrt(b[0]*b[0]+b[1]*b[1])
      padding = 0.05 * diagonal

      positionOffset = [[0, 0, -1], [1, 0, 0], [0, 1, 0]]
      upVector       = [[0, -1, 0], [0, -1, 0], [0, 0, -1]]

      to.dx = positionOffset[id][0]
      to.dy = positionOffset[id][1]
      to.dz = positionOffset[id][2]
      to.upX = upVector[id][0]; to.upY = upVector[id][1]; to.upZ = upVector[id][2]
      to.l = -offsetX; to.t = offsetY
      to.r = to.l + width; to.b = to.t - width
