                 @controls.autoRotateSpeed = @opts.spin
             @controls.autoRotate = true
 
-        @controls.addEventListener 'change', () => if @renderer_type=='dynamic' then @renderer.render(@scene, @camera)
-        # @controls.addEventListener 'end',    () => @set_static_renderer()
-        # @controls.addEventListener 'start',  () =>
+        @controls.addEventListener 'change', () =>
+            if @renderer_type=='dynamic'
+                @rescale_objects()
+                @renderer.render(@scene, @camera)
+
 
 
     add_camera: (opts) =>

            return

        # rescale all text in scene
        if (new_pos or force) and @_center?
            s = @camera.position.distanceTo(@_center) / 3
            if @_text?
                for sprite in @_text
                    sprite.scale.set(s,s,s)
            if @_frame_labels?
                for sprite in @_frame_labels
                    sprite.scale.set(s,s,s)

        @renderer.render(@scene, @camera)



$.fn.salvus_threejs = (opts={}) ->

            sizeAttenuation : false
        @show_canvas()

        # IMPORTANT: Below we use sprites instead of the more natural/faster PointCloudMaterial.
        # Why?  Because usually people don't plot a huge number of points, and PointCloudMaterial is SQUARE.
        # By using sprites, our points are round, which is something people really care about. 

        switch dynamic_renderer_type

            when 'webgl'
                width   = 50
                height  = 50
                canvas = document.createElement( 'canvas' )
                canvas.width = width
                canvas.height = height
                context = canvas.getContext("2d")  # get the drawing context

                centerX = width / 2
                centerY = height / 2
                radius = 25
                context.beginPath()
                context.arc(centerX, centerY, radius, 0, 2*Math.PI, false)
                context.fillStyle = o.color
                context.fill()
                texture = new THREE.Texture(canvas)
                texture.needsUpdate = true
                spriteMaterial = new THREE.SpriteMaterial(map: texture)
                particle = new THREE.Sprite(spriteMaterial)
                p = @aspect_ratio_scale(o.loc)
                particle.position.set(p[0],p[1],p[2])
                z = [particle, o.size/200]
                if not @_points?
                    @_points = [z]
                else
                    @_points.push(z)

            when 'canvas'
                # inspired by http://mrdoob.github.io/three.js/examples/canvas_particles_random.html
                PI2 = Math.PI * 2
                program = (context) ->
                    context.beginPath()
                    context.arc(0, 0, 0.5, 0, PI2, true)
                    context.fill()
                material = new THREE.SpriteCanvasMaterial
                    color   : new THREE.Color(o.color)
                    program : program
                particle = new THREE.Sprite(material)
                p = @aspect_ratio_scale(o.loc)
                particle.position.set(p[0],p[1],p[2])
                z = [particle, 4*o.size/@opts.width]
                if not @_points?
                    @_points = [z]
                else
                    @_points.push(z)
            else
                throw "bug -- uknown dynamic_renderer_type = #{dynamic_renderer_type}"

