21 |
|
* String arguments include the reflection function and files. |
22 |
|
* The BRDF is currently used just for the specular component to light |
23 |
|
* sources. Reflectance values or data coordinates are functions |
24 |
< |
* of the direction to the light source. |
24 |
> |
* of the direction to the light source. (Data modification functions |
25 |
> |
* are passed the source direction as args 2-4.) |
26 |
|
* We orient the surface towards the incoming ray, so a single |
27 |
|
* surface can be used to represent an infinitely thin object. |
28 |
|
* |
89 |
|
COLOR ctmp; |
90 |
|
FVECT ldx; |
91 |
|
double lddx[3], pt[MAXDIM]; |
92 |
+ |
double vldx[4]; |
93 |
|
register char **sa; |
94 |
|
register int i; |
95 |
|
|
155 |
|
} else { |
156 |
|
for (i = 0; i < np->dp->nd; i++) |
157 |
|
pt[i] = funvalue(sa[3+i], 3, lddx); |
158 |
< |
dtmp = datavalue(np->dp, pt); |
159 |
< |
dtmp = funvalue(sa[0], 1, &dtmp); |
158 |
> |
vldx[0] = datavalue(np->dp, pt); |
159 |
> |
vldx[1] = lddx[0]; vldx[2] = lddx[1]; vldx[3] = lddx[2]; |
160 |
> |
dtmp = funvalue(sa[0], 4, vldx); |
161 |
|
setcolor(ctmp, dtmp, dtmp, dtmp); |
162 |
|
} |
163 |
|
if (errno) { |
197 |
|
double transtest, transdist; |
198 |
|
int hasrefl, hastrans; |
199 |
|
COLOR ctmp; |
197 |
– |
double dtmp; |
200 |
|
register MFUNC *mf; |
201 |
|
register int i; |
202 |
|
/* check arguments */ |
241 |
|
/* compute transmitted ray */ |
242 |
|
setbrdfunc(&nd); |
243 |
|
transtest = 0; |
244 |
+ |
transdist = r->rot; |
245 |
|
errno = 0; |
246 |
|
setcolor(ctmp, evalue(mf->ep[3]), |
247 |
|
evalue(mf->ep[4]), |