home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / raytrace / radiance / lib / fisheye.cal < prev    next >
Encoding:
Text File  |  1990-04-30  |  280 b   |  13 lines

  1. {
  2.     Calculate coordinates for a 180 degree fisheye lens.
  3.     Assume view direction is (0,1,0), view up (0,0,1), (1,0,0) right.
  4.  
  5.     4/30/90
  6. }
  7.  
  8. fish_u = .5 + Dx/fish_Rxz * fish_Ry;
  9. fish_v = .5 + Dz/fish_Rxz * fish_Ry;
  10.  
  11. fish_Rxz = sqrt(Dx*Dx + Dz*Dz);
  12. fish_Ry = acos(Dy) / PI;
  13.