rewrite from scratch as three.js based project