I found myself needing an app template each time I wanted to create a new Three.js experiment. Previously, I would duplicate an old piece of code and use it as the basis for something new. However, with this approach, I would often end up copying over old, unnecessary code and find myself having to delete chunks of unwanted functionality. I did make a command line Python based generator but it was a bit too limited and obviously, didn't offer any kind of visual feedback as you made changes to the options. So, I put this together to help me and thought maybe other amateur three.js hackers like myself might find it useful too.
How it works:
There is a template file that describes all possible source options and has a regex for each line. When you change the UI, a signature is created that represent the selected options. The signature is evaluated against the regex for each line to test if the line needs to be included in the output. Seems to work pretty well and it's quite easy to add new options.
Recent changes:
Sounds a bit grandiose for what amounts to a quick hack but these are some things I'd like to add in the future when my absurdly cute 2 year old daughter allows me some time :)
Added feature to send code to JS Fiddle (you have to hit Run button after - bug??)
Added option to include helper geometry like bounding box, light helpers, normal markers etc.
Future plans:
Sounds a bit grandiose for what amounts to a quick hack but these are some things I'd like to add in the future when my absurdly cute 2 year old daughter allows me some time :)
Fix the JS Fiddle code so dat.GUI works properly
Example objects constructed using various kinds of buffer geometry
Ability to select older or newer (development) versions of three.js (The Python script had this feature but I never actually used it so maybe it's not useful)
Enable the mobile / iOS 8 optimizations check box once I figure out what they are :)
Test on more browsers/platforms. I use Chrome on Windows and OS X so I was able to try it there but I'd like to make sure it behaves okay on other OSs like Linux and other browsers like Firefox.