Original Post
sorry i started this topic asking the formula for spherical mapping, because mine didn't work. But it was just a coding bug (x instead of z).
Anyway here it is if people are intersted
void SphereMap(x,y,z,radius,u,v)
double x,y,z,r,*u,*v;
{
*v = acos(z/radius) / PI;
if (y >= 0)
*u = acos(x/(radius * sin(PI*(*v)))) / TWOPI;
else
*u = (PI + acos(x/(radius * sin(PI*(*v))))) / TWOPI;
}
cya
[edited by - tibo on May 22, 2003 12:33:02 PM]