home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
RADIANCE
/
LIB
/
BALL.CAL
< prev
next >
Wrap
Text File
|
1993-10-07
|
377b
|
18 lines
{
ball.cal - 2d coordinate mapping onto sphere.
unit sphere centered at origin
A1 = picture height/width
A2 = unit scale for pattern
}
ball_u = atan2(Py,Px)*Sqrt(1-Pz*Pz)/A2;
ball_v = Acos(Pz)/A2;
ball_tile_u = mod(ball_u,max(1,1/A1));
ball_tile_v = mod(ball_v,max(1,A1));
ball_match_u = tri(ball_u,max(1,1/A1));
ball_match_v = tri(ball_v,max(1,A1));