--- ray/src/gen/gensky.c 1992/10/23 14:19:35 2.8 +++ ray/src/gen/gensky.c 1993/06/04 14:30:24 2.10 @@ -1,4 +1,4 @@ -/* Copyright (c) 1986 Regents of the University of California */ +/* Copyright (c) 1992 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -19,9 +19,6 @@ static char SCCSid[] = "$SunId$ LBL"; #include "color.h" -#ifndef atof -extern double atof(); -#endif extern char *strcpy(), *strcat(), *malloc(); extern double stadj(), sdec(), sazi(), salt(); @@ -150,6 +147,14 @@ computesky() /* compute sky parameters */ st = hour + stadj(jd); altitude = salt(sd, st); azimuth = sazi(sd, st); + } + if (!cloudy && altitude > 87.*PI/180.) { + fprintf(stderr, +"%s: warning - sun too close to zenith, reducing altitude to 87 degrees\n", + progname); + printf( +"# warning - sun too close to zenith, reducing altitude to 87 degrees\n"); + altitude = 87.*PI/180.; } sundir[0] = -sin(azimuth)*cos(altitude); sundir[1] = -cos(azimuth)*cos(altitude);