mrdoob/three.js — pull request #1835 by Pitel (2012-04-29 13:53:35+00:00)
Title: Fixed normal to RGB encoding

The X and Y parts of calculated normal vector are in +-1 range. So to transform them to 0-255 range, you have to add 1, divide by 2 and multiply by 255.

Also, the `| 0` in the ends is a bit confusing at first. `Math.floor()` is more readable (but maybe slower).