mrdoob/three.js — pull request #3685 by DavidSouther (2013-07-26 14:57:31+00:00)
Title: Examples - Complete refactor

**Zeroth**, this pull request is looking for community input, and not intended to be merged as-is.

### The Why:
Three.js is a godsend for creating 3D programs, and frankly one of the most useful JS libraries I've come across. The example code should embody the best practices for using three, while being pedagogically useful. To that end, I've reworked the examples in a few ways.

### The what:

**First**, I've redone the layout of the examples folder, building a directory structure into the implicit hierarchy currently build with underscores in paths.

Moving the examples into folders on the underscores spreads those 200 files into 8 folders (one for each renderer); the WebGL folder, with the vast majority of the examples, has 21 subfolders broken down on example type, and another 20 examples in the folder directly. To see what this new structure looks like, browse the tree at https://github.com/DavidSouther/three.js/tree/73f77/examples

**Second**, I've been working on a library to further ease creating new projects. [S3age](https://github.com/DavidSouther/s3age) handles creating a scene, camera, and WebGL renderer, hooking them up, listening for window resize events, and more. Porting a few examples to sage reduces their JS size significantly, letting the code show *how* to achieve an effect. See
* [cubes](https://github.com/DavidSouther/three.js/blob/1dcfe/examples/webgl/interactive/cubes.html)
* [knight](https://github.com/DavidSouther/three.js/blob/aa50985/examples/webgl/animation/skinning_morph.html)
* [postprocessing](https://github.com/DavidSouther/three.js/blob/02e7b7/examples/webgl/postprocessing2.html)
* [trails](https://github.com/DavidSouther/three.js/blob/9595663/examples/webgl/trails.html)

### The ask:

What do others in the Threejs community think of this approach? Does the S3age class make sense? It would make the Getting Started go from [20 lines of render init](http://threejs.org/docs/59/#Manual/Introduction/Creating_a_scene) to [20 lines of commented scene layout](https://github.com/DavidSouther/s3age/blob/examples/src/examples/01_blender_factory.html). Would people use it? If so, would anyone else take the time to work with me on cleaning up the example code, making it useful and pedagogic? (Migrating the file structure would take another 20 minutes, that's not a big deal, if people like the new layout.)