157 |
|
setcolor(thisray.rcol, 0.0, 0.0, 0.0); |
158 |
|
} else { |
159 |
|
rayorigin(&thisray, NULL, PRIMARY, 1.0); |
160 |
+ |
samplendx++; |
161 |
|
rayvalue(&thisray); |
162 |
|
} |
163 |
|
|
179 |
|
{ |
180 |
|
/* free old image */ |
181 |
|
freepkids(&ptrunk); |
182 |
+ |
/* save reserve memory */ |
183 |
+ |
fillreserves(); |
184 |
|
/* compute resolution */ |
185 |
|
hresolu = dev->xsiz; |
186 |
|
vresolu = dev->ysiz; |
435 |
|
vp->vert = asin(vp->vert) / (PI/180./2.); |
436 |
|
return; |
437 |
|
} |
435 |
– |
} |
436 |
– |
|
437 |
– |
|
438 |
– |
spinvector(vres, vorig, vnorm, theta) /* rotate vector around normal */ |
439 |
– |
FVECT vres, vorig, vnorm; |
440 |
– |
double theta; |
441 |
– |
{ |
442 |
– |
extern double sin(), cos(); |
443 |
– |
double sint, cost, dotp; |
444 |
– |
FVECT vperp; |
445 |
– |
register int i; |
446 |
– |
|
447 |
– |
if (theta == 0.0) { |
448 |
– |
VCOPY(vres, vorig); |
449 |
– |
return; |
450 |
– |
} |
451 |
– |
sint = sin(theta); |
452 |
– |
cost = cos(theta); |
453 |
– |
dotp = DOT(vorig, vnorm); |
454 |
– |
fcross(vperp, vnorm, vorig); |
455 |
– |
for (i = 0; i < 3; i++) |
456 |
– |
vres[i] = vnorm[i]*dotp*(1.-cost) + |
457 |
– |
vorig[i]*cost + vperp[i]*sint; |
438 |
|
} |