You need to be very careful here to avoid patent infringement! ;)http://www.google.com/patents/WO1993023835A1
..don't we love the bad joke called software patent? :D
Anyway, I'm assuming you're after "being inside a textured ball" and I'd vote for what bonker described! - ray cast it on a course grid and interpolate the [u,v] between the grid points. A bit more complicated that some magical table approach but in the end I think it'll be easier (and a good algo to have around for other nice things).
The major issue is how achieve a efficient mapping, you can't just bend a paper around a ball, so you either get a mapping with very low resolution towards the poles for example, or you need to "cut" your texture/uv-space into parts. You can see an example of both the technique and the mapping problem in the second screenshot of this one:Powerline - Repugnance (ADA)
If you run it, you'll definitely see the issue. I simply mapped the [u,v] along 2 dimensions of the sphere - well egg in my case.
Now, I've been thinking about this lately and I'd say the easiest
solution is to simply have several versions of the texture and switch between them depending on the angle. A more complicated approach could be blending the textures. An even more complicated way could be to accurately select the appropriate texture for each pixel. That would require (for example) to identify tiles in the the grid that needs to be subdivided further - those tiles where "a line passes through" with one preferred texture on one side and another on the other.
Btw, If anyone have any ideas on good ways of how to texture a sphere in general (i.e. map texture(s) onto it) I'd be happy to hear them!**Disclamer: the one who "designed" the textures has requested perpetual anonymity. ;D