                 addLabel [max.x, max.y, min.z], format(max.x)
                 addLabel [avg.x, max.y, min.z], "x = #{format avg.x}"
                 addLabel [min.x, max.y, min.z], format(min.x)
+
+    updateCamera: ->
+        center = @rescale @boundingBox.geometry.boundingBox.center()
+
+        @camera.lookAt center
+        @controls.target = center
+
+        @camera.position.set 1.5, 1.5, 0.75
+        @camera.position.multiplyScalar(@maxDim).add center
+
+        @camera.far = @maxDim*16
+        @camera.near = @minDim/4
+        @camera.updateProjectionMatrix()
 
     animate: (opts = {}) ->
         opts = defaults opts,

            else
                console.log "ERROR: bad object type #{opts.obj.type}"

    # always call this after adding things to the scene to make sure track
    # controls are sorted out, etc.   Set draw:false, if you don't want to
    # actually *see* a frame.
    set_frame: ->
        ###
        if Math.abs(x1 - x0) < eps
            x1 += 1

            @element.className = 'math-3d-viewer'

        parentElement.appendChild @element

    setDynamicRenderer: ->
        if @renderer_type is 'dynamic'
