1 |
< |
/* Copyright (c) 1995 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1999 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
4 |
> |
static char SCCSid[] = "$SunId$ SGI"; |
5 |
|
#endif |
6 |
|
|
7 |
|
/* |
674 |
|
{ |
675 |
|
FVECT pt, tdir, odir; |
676 |
|
double d; |
677 |
– |
register int i; |
677 |
|
|
678 |
|
if (pos[2] <= 0) /* empty pixel */ |
679 |
|
return(0); |
718 |
|
return(0); |
719 |
|
if (!averaging) |
720 |
|
return(1); |
721 |
< |
if (ourview.type == VT_PAR) /* compute our direction */ |
722 |
< |
VCOPY(odir, ourview.vdir); |
723 |
< |
else |
724 |
< |
for (i = 0; i < 3; i++) |
725 |
< |
odir[i] = (pt[i] - ourview.vp[i])/pos[2]; |
726 |
< |
d = DOT(odir,tdir); /* compute pixel weight */ |
727 |
< |
if (d >= 1.-1./MAXWT/MAXWT) |
721 |
> |
/* compute pixel weight */ |
722 |
> |
if (ourview.type == VT_PAR) { |
723 |
> |
d = DOT(ourview.vdir,tdir); |
724 |
> |
d = 1. - d*d; |
725 |
> |
} else { |
726 |
> |
VSUB(odir, pt, ourview.vp); |
727 |
> |
d = DOT(odir,tdir); |
728 |
> |
d = 1. - d*d/DOT(odir,odir); |
729 |
> |
} |
730 |
> |
if (d <= 1./MAXWT/MAXWT) |
731 |
|
return(MAXWT); /* clip to maximum weight */ |
732 |
< |
return(1./sqrt(1.-d)); |
732 |
> |
return(1./sqrt(d)); |
733 |
|
} |
734 |
|
|
735 |
|
|