     # Do some animation
     requestAnimationFrame(@render);
 
+    @_update(time_step)
+
+    @renderer.render(@scene, @camera);
+
+    @_stats.end()
+
+  _update: (time_step) ->
+    @_directional_light.visible = @light
+
     if @animate
       @mesh.rotation.x += 2 * time_step;
       @mesh.rotation.y += 2 * time_step;
-
-    @renderer.render(@scene, @camera);
-
-    @_stats.end()
 
   _init_root: () ->
     width = $(@elem_root).width()

class @ThreejsScene
  constructor: (@elem_root, @animate = true, @light = true) ->
    @_stats = new Stats()
    @_init_root()
    @_create_basic_scene()



default_vertex_source =
"""
//uniform vec3 light;
//varying vec3 vNormal;

void main() {
//  vNormal = normal;
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);
}

