Mr Speaker

Category: Game

#Random Hex colour

Want a random colour between white and black? “#” + (Math.random() * 0xffffff | 0).toString(16) That is all. [Update: after I posted this I thought… i bet this has been done a zillion times already. It was, and by Paul Irish in 2009 no less. Additionally – it doesn’t work. The best looking one there […]

Three.js: looking away from .lookAt

Have a hankering to look in the opposite direction of the vector you get from Three.js’s .lookAt function? You need .lookAwayFrom! Dunno if there’s an easier way, but the idea is find the vector between the target you’d normally “look at” and you, then add the resultant to your current position, and look at that […]