         else
             @element = document.createElement 'span'
             @element.className = 'math-3d-viewer'
+            @element.style.display = 'inline-block'
 
         parentElement.appendChild @element
 

            type    : 'png'      # 'png' or 'jpeg' or 'webp' (the best)
            quality : undefined   # 1 is best quality; 0 is worst; only applies for jpeg or webp
        @renderer.domElement.toDataURL "image/#{opts.type}", opts.quality

    init_light: (color= 0xffffff) ->
        ambient = new THREE.AmbientLight(0x404040)
        @scene.add ambient

        color = 0xffffff
        d     = 10000000
        intensity = 0.5

        for p in [[d,d,d], [d,d,-d], [d,-d,d], [d,-d,-d],[-d,d,d], [-d,d,-d], [-d,-d,d], [-d,-d,-d]]
            directionalLight = new THREE.DirectionalLight color, intensity
            directionalLight.position.set(p...).normalize()
            @scene.add directionalLight

        @light = new THREE.PointLight color
        @light.position.set 0, d, 0

    updateBoundingBox: (obj) ->
        obj.geometry.computeBoundingBox()

            @_stop_animating = false
            @_animate_started = false
            return
        @renderScene opts.render
        delete opts.render
        f = =>
            requestAnimationFrame (=> @_animate opts)
