         @debug_canvas.style.transform = 'scaleY(-1)'
         document.body.appendChild @debug_canvas
         @ctx = null
-    
+
     destroy_debug_canvas: ->
         document.body.removeChild @debug_canvas
         @ctx = null

            @ctx = null
        @step = 0

    init: (scene, camera) ->
        @add_scene(scene)
        @scene = scene
        @camera = camera
        do_step_callback = (scene, frame_duration)=>
            @do_step()
        scene.post_draw_callbacks.push do_step_callback

    add_scene: (scene) ->
        for ob in scene.children

            @pixels.subarray(coords.index, coords.index+4))
        gl.scissor(0, 0, @width, @height)
        @pick_object(x, y)

    create_debug_canvas: ->
        if @debug_canvas?
            @destroy_debug_canvas()
