   xp = x/s - 1
   yp = y/s - 1
   xyt = poincare2hyperblic xp, yp
-  #inverse transform it...
-  xyt = M.mulv (M.inv tfm), xyt
   if xyt isnt null
+    #inverse transform it...
+    xyt = M.mulv (M.inv observer.tfm), xyt
     visibleCell = xytFromCell xyt
     cell = eliminateFinalA appendRewrite(observer.center, node2array(visibleCell)), appendRewrite, tessellation.group.n
     #console.log showNode cell

  mouseDown: ->
    

jumpLimit = 1.5
  
modifyView = (m) ->
  tfm = M.mul m, tfm
  checkViewMatrix()
  originDistance = viewDistanceToOrigin()
  if originDistance > jumpLimit
    rebaseView()

  observer.renderGrid tfm

viewDistanceToOrigin = ->
  #viewCenter = M.mulv tfm, [0.0,0.0,1.0]
  #Math.acosh(viewCenter[2])
  Math.acosh tfm[8]

#build new view around the cell which is currently at the center
rebaseView = ->
  centerCoord = M.mulv (M.inv tfm), [0.0, 0.0, 1.0]
  pathToCenterCell = xytFromCell centerCoord
  #console.log "Jump by #{showNode pathToCenterCell}"
  m = nodeMatrixRepr pathToCenterCell, tessellation.group

  #modifyView won't work, since it multiplies in different order.
  tfm = M.mul tfm, m
  checkViewMatrix()

  #move observation point
  observer.translateBy node2array pathToCenterCell

updatePopulation = ->
  E('population').innerHTML = ""+cells.count

    @cellOffsets = (node2array(c) for c in @cells)
    @cellTransforms = (nodeMatrixRepr(c, @tessellation.group) for c in @cells)
    @drawEmpty = true
    @jumpLimit = 1.5
    @tfm = M.eye()
    
    @viewUpdates = 0
    #precision falls from 1e-16 to 1e-9 in 1000 steps.
    @maxViewUpdatesBeforeCleanup = 500
  

  rebuildAt: (newCenter) ->
    @center = newCenter
    @cells = for offset in @cellOffsets
