             @element.className = 'math-3d-viewer'
 
         parentElement.appendChild @element
-
-    # client code should call this when done adding objects to the scene
-    finalize: ->
-        @set_frame()
-
-        center = @rescale @boundingBox.geometry.boundingBox.center()
-
-        @camera.lookAt center
-        @controls.target = center
-
-        dim = @rescale @boundingBox.geometry.boundingBox.size()
-
-        maxDim = Math.max dim.x, dim.y, dim.z
-
-        @camera.position.set 1.5, 1.5, 0.75
-        @camera.position.multiplyScalar(maxDim).add center
-
-        @render_scene()
-
-        # possibly show the canvas warning.
-        if @opts.renderer is 'canvas'
-            @element.title = 'WARNING: using slow non-WebGL canvas renderer'
 
     setDynamicRenderer: ->
         if @renderer_type is 'dynamic'


            @opts.callback? undefined, @

    attachToDom: (parentElement) ->
        if @element?
            removeElement @element

                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,
