Color faces based on world space normal
You can do this in cycles using the Vector Transform node:



No matter how the object is rotated, the faces facing a particular direction are always the same color.

To map colors to the normals, you can use Separate and Combine RGB nodes to manipulate each channel individually: