Re:A 3Dish, pixelartish head on a wall. Something I built ov...
by manmeet on Tuesday April 22, 2014 @05:40PM
(#7630659)
super cool, how did u manage the physics
[ Parent
| on HN ]
Re:A 3Dish, pixelartish head on a wall. Something I built ov...
by wjagodfrey on Tuesday April 22, 2014 @06:25PM
(#7630878)
Thanks! So there's not really physics as such. The face is made up of layers that move based on the mouse position.
Each layer has a distance it's allowed to travel away from its center point, and it gets the distance of the mouse from the center of the page, and then moves the layer by the proportionate amount of its allowed travel distance. It uses easing to make it feel more natural. I hope that makes sense.
There's more going on here, but that's the gist of it. If you're curious check out the code on [git](https://github.com/wilfredjamesgodfrey/hector).