Singing Potatoes
Thursday, 18 March 2004
The Internet Knows All!

I love it when the Internet can answer my questions. For example:

If for a direction vector in the world (Dx, Dy, Dz), the corresponding (u,v) coordinate in the light probe image is (Dx*r,Dy*r) where r=(1/pi)*acos(Dz)/sqrt(Dx^2 + Dy^2).

...and...

... for mirrored ball maps... r = sin(acos(Dz)/2) / sqrt(Dx^2 + Dy^2)
Posted by godfrey (link)
Comments
Just reading this entry hurts my head, I don't dare click on those links!
heh, heh, you said "probe"!
It's starting to feel like a different kind of probe. I've been trying all day, and I can't seem to make either formula work. All I get are moiré smears. Oh, and division by zero errors. Clearly if your rotational vector is <0,0,0> (looking straight ahead), then dividing by sqrt(Dx^2+Dy^2) is going to produce an error.

Oh, man, do I feel like an idiot. It clearly states direction vector, not rotation angle. I am such a chump.

Don't feel bad. I mixed those up just the other day while driving!