Adapting three.js boilerplate