home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / NEWS / RADIANCE / LIB / BALL.CAL < prev    next >
Text File  |  1993-10-07  |  377b  |  18 lines

  1. {
  2.     ball.cal - 2d coordinate mapping onto sphere.
  3.  
  4.     unit sphere centered at origin
  5.  
  6.     A1 = picture height/width
  7.     A2 = unit scale for pattern
  8. }
  9.  
  10. ball_u = atan2(Py,Px)*Sqrt(1-Pz*Pz)/A2;
  11. ball_v = Acos(Pz)/A2;
  12.  
  13. ball_tile_u = mod(ball_u,max(1,1/A1));
  14. ball_tile_v = mod(ball_v,max(1,A1));
  15.  
  16. ball_match_u = tri(ball_u,max(1,1/A1));
  17. ball_match_v = tri(ball_v,max(1,A1));
  18.