adapted to new three.js