--- ray/src/common/multisamp.c 1991/11/12 16:56:06 2.1 +++ ray/src/common/multisamp.c 2003/02/25 02:47:21 2.4 @@ -1,15 +1,17 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: multisamp.c,v 2.4 2003/02/25 02:47:21 greg Exp $"; #endif - /* * Binary space partitioning curve for multidimensional sampling. * * Written by Christophe Schlick */ +#include "copyright.h" + +#include "random.h" + +void multisamp(t, n, r) /* convert 1-dimensional sample to N dimensions */ double t[]; /* returned N-dimensional vector */ register int n; /* number of dimensions */ @@ -33,5 +35,5 @@ double r; /* 1-dimensional sample [0,1) */ } i = n; while (i-- > 0) - t[i] = 1./256. * ti[i]; + t[i] = 1./256. * (ti[i] + frandom()); }