     if (@viewUpdates+=1) > @maxViewUpdatesBeforeCleanup
       @viewUpdates = 0
       @tfm = M.cleanupHyperbolicMoveMatrix @tfm
-
     
   modifyView: (m) ->
     @tfm = M.mul m, @tfm

    if originDistance > @jumpLimit
      @rebaseView()
    @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



    #move observation point
    @translateBy node2array pathToCenterCell

  #xp, yp in range [-1..1]
  cellFromPoint:(xp,yp) ->
    xyt = poincare2hyperblic xp, yp
    throw new Error("point outside") if xyt is null
    #inverse transform it...
    xyt = M.mulv (M.inv @tfm), xyt
    visibleCell = @xyt2path xyt
    eliminateFinalA @appendRewrite(@center, node2array(visibleCell)), @appendRewrite, @tessellation.group.n
    
  shutdown: -> #nothing to do.
  
class FieldObserverWithRemoreRenderer extends FieldObserver
  constructor: (tessellation, appendRewrite, minCellSize=1.0/400.0)->
    super tessellation, appendRewrite, minCellSize
