This is remotely related to this subject:
How do I get the downhill pointing vector (in 3D) of a heightfield terrain (or any shape maybe) if I just have the normal of the surface?
I guess this vector would be a tangent of the surface.
Off the top of my head I'd say this is calculated by taking the cross product of the global up axis (0, 1, 0) and the face normal:
vector3 downhill = cross(up, normal);
I can't try it right now because I'm at work. Can somebody verify or correct this?
Edit:
Ok, had a second thought on this. The above will give me the sideways direction (as opposed to downhill) of the surface. I guess that's the binormal/bitangent. Now I think I should calculate a second cross product of the normal and this vector to get the downhill vector!
Like this:
vector3 binormal = cross(up, normal);
vector3 downhill = cross(binormal, normal);
Any thoughts? (Still can't test it yet...)