Javascript framework for scene management