     @requestRender()
 
   onMouseWheel: (e) =>
-    @position.z = Math.max -500, Math.min -1, @position.z - e.wheel*10
+    maxDistance = 100
+    console.log (@position.z/maxDistance)
+    @position.z = Math.max -maxDistance, Math.min 0.001, @position.z - 20*e.wheel*(@position.z/maxDistance)
     
     @update()
     @requestRender()

      width: @opts.width?() || @$glCanvas.parent().innerWidth()
      height: @opts.height?() || @$glCanvas.parent().innerHeight()
    @$glCanvas.attr @size
    #@$glCanvas.attr height: @size.height
    console.log @size
    @gl.viewport(0, 0, @size.width, @size.height)
    @camera.aspect = @size.width / @size.height
    @camera.update()


  _onO3DLoad: (opts, p3d, o3d) =>
    #console.log p3d
    window.a = p3d.blob if p3d?
    @_alignModel o3d, opts.alignment if opts.alignment?
    opts.init(o3d) if opts.init?
    #o3d.drawType = @gl.LINES
    o3d.update()
    if o3d == @model
      @position.y = -(@model.dimensions?[2] * @model.scale[2]||0)/2
    @scene.add o3d
    @update()
    @requestRender()
