| 13 |
|
|
| 14 |
|
#include "ray.h" |
| 15 |
|
#include "rpaint.h" |
| 16 |
+ |
#include "otypes.h" |
| 17 |
+ |
#include "otspecial.h" |
| 18 |
|
#include "random.h" |
| 19 |
|
|
| 20 |
|
#ifndef WFLUSH |
| 21 |
< |
#define WFLUSH 2048 /* flush after this many rays */ |
| 21 |
> |
#define WFLUSH 64 /* flush after this many primary rays */ |
| 22 |
|
#endif |
| 23 |
+ |
#ifndef WFLUSH1 |
| 24 |
+ |
#define WFLUSH1 512 /* or this many total rays */ |
| 25 |
+ |
#endif |
| 26 |
|
|
| 27 |
+ |
|
| 28 |
|
#ifdef SMLFLT |
| 29 |
|
#define sscanvec(s,v) (sscanf(s,"%f %f %f",v,v+1,v+2)==3) |
| 30 |
|
#else |
| 31 |
|
#define sscanvec(s,v) (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3) |
| 32 |
|
#endif |
| 33 |
|
|
| 34 |
+ |
extern int ray_pnprocs; |
| 35 |
|
|
| 36 |
+ |
static RNUMBER niflush; /* flushes since newimage() */ |
| 37 |
+ |
|
| 38 |
|
int |
| 39 |
< |
getrect(s, r) /* get a box */ |
| 40 |
< |
char *s; |
| 41 |
< |
register RECT *r; |
| 39 |
> |
getrect( /* get a box */ |
| 40 |
> |
char *s, |
| 41 |
> |
RECT *r |
| 42 |
> |
) |
| 43 |
|
{ |
| 44 |
|
int x0, y0, x1, y1; |
| 45 |
|
|
| 84 |
|
|
| 85 |
|
|
| 86 |
|
int |
| 87 |
< |
getinterest(s, direc, vec, mp) /* get area of interest */ |
| 88 |
< |
char *s; |
| 89 |
< |
int direc; |
| 90 |
< |
FVECT vec; |
| 91 |
< |
double *mp; |
| 87 |
> |
getinterest( /* get area of interest */ |
| 88 |
> |
char *s, |
| 89 |
> |
int direc, |
| 90 |
> |
FVECT vec, |
| 91 |
> |
double *mp |
| 92 |
> |
) |
| 93 |
|
{ |
| 94 |
|
int x, y; |
| 95 |
|
RAY thisray; |
| 96 |
< |
register int i; |
| 96 |
> |
int i; |
| 97 |
|
|
| 98 |
|
if (sscanf(s, "%lf", mp) != 1) |
| 99 |
|
*mp = 1.0; |
| 116 |
|
} |
| 117 |
|
if (!direc || ourview.type == VT_PAR) { |
| 118 |
|
rayorigin(&thisray, PRIMARY, NULL, NULL); |
| 119 |
< |
if (!localhit(&thisray, &thescene)) { |
| 119 |
> |
while (localhit(&thisray, &thescene)) { |
| 120 |
> |
OBJREC *m = findmaterial(thisray.ro); |
| 121 |
> |
if (m != NULL && !istransp(m->otype) && |
| 122 |
> |
!isBSDFproxy(m) && |
| 123 |
> |
(thisray.clipset == NULL || |
| 124 |
> |
!inset(thisray.clipset, |
| 125 |
> |
thisray.ro->omod))) |
| 126 |
> |
break; /* found something */ |
| 127 |
> |
VCOPY(thisray.rorg, thisray.rop); |
| 128 |
> |
rayclear(&thisray); /* skip invisible */ |
| 129 |
> |
} |
| 130 |
> |
if ((thisray.ro == NULL) | (thisray.ro == &Aftplane)) { |
| 131 |
|
error(COMMAND, "not a local object"); |
| 132 |
|
return(-1); |
| 133 |
|
} |
| 152 |
|
} |
| 153 |
|
|
| 154 |
|
|
| 155 |
< |
float * /* keep consistent with COLOR typedef */ |
| 156 |
< |
greyof(col) /* convert color to greyscale */ |
| 157 |
< |
register COLOR col; |
| 155 |
> |
COLORV * |
| 156 |
> |
greyof( /* convert color to greyscale */ |
| 157 |
> |
COLOR col |
| 158 |
> |
) |
| 159 |
|
{ |
| 160 |
|
static COLOR gcol; |
| 161 |
|
double b; |
| 165 |
|
return(gcol); |
| 166 |
|
} |
| 167 |
|
|
| 168 |
+ |
static void |
| 169 |
+ |
recolor( /* recolor the given node */ |
| 170 |
+ |
PNODE *p |
| 171 |
+ |
) |
| 172 |
+ |
{ |
| 173 |
+ |
while (p->kid != NULL) { /* need to propogate down */ |
| 174 |
+ |
int mx = (p->xmin + p->xmax) >> 1; |
| 175 |
+ |
int my = (p->ymin + p->ymax) >> 1; |
| 176 |
+ |
int ki; |
| 177 |
+ |
if (p->x >= mx) |
| 178 |
+ |
ki = (p->y >= my) ? UR : DR; |
| 179 |
+ |
else |
| 180 |
+ |
ki = (p->y >= my) ? UL : DL; |
| 181 |
+ |
pcopy(p, p->kid+ki); |
| 182 |
+ |
p = p->kid + ki; |
| 183 |
+ |
} |
| 184 |
|
|
| 185 |
< |
void |
| 186 |
< |
paint(p, xmin, ymin, xmax, ymax) /* compute and paint a rectangle */ |
| 187 |
< |
register PNODE *p; |
| 188 |
< |
int xmin, ymin, xmax, ymax; |
| 185 |
> |
(*dev->paintr)(greyscale?greyof(p->v):p->v, |
| 186 |
> |
p->xmin, p->ymin, p->xmax, p->ymax); |
| 187 |
> |
} |
| 188 |
> |
|
| 189 |
> |
int |
| 190 |
> |
paint( /* compute and paint a rectangle */ |
| 191 |
> |
PNODE *p |
| 192 |
> |
) |
| 193 |
|
{ |
| 151 |
– |
static unsigned long lastflush = 0; |
| 194 |
|
static RAY thisray; |
| 195 |
|
double h, v; |
| 196 |
|
|
| 197 |
< |
if (xmax - xmin <= 0 || ymax - ymin <= 0) { /* empty */ |
| 198 |
< |
p->x = xmin; |
| 199 |
< |
p->y = ymin; |
| 197 |
> |
if ((p->xmax <= p->xmin) | (p->ymax <= p->ymin)) { /* empty */ |
| 198 |
> |
p->x = p->xmin; |
| 199 |
> |
p->y = p->ymin; |
| 200 |
|
setcolor(p->v, 0.0, 0.0, 0.0); |
| 201 |
< |
return; |
| 201 |
> |
return(0); |
| 202 |
|
} |
| 203 |
|
/* jitter ray direction */ |
| 204 |
< |
h = xmin + (xmax-xmin)*frandom(); |
| 205 |
< |
v = ymin + (ymax-ymin)*frandom(); |
| 204 |
> |
p->x = h = p->xmin + (p->xmax-p->xmin)*frandom(); |
| 205 |
> |
p->y = v = p->ymin + (p->ymax-p->ymin)*frandom(); |
| 206 |
|
|
| 207 |
|
if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, &ourview, |
| 208 |
|
h/hresolu, v/vresolu)) < -FTINY) { |
| 209 |
|
setcolor(thisray.rcol, 0.0, 0.0, 0.0); |
| 210 |
< |
} else { |
| 210 |
> |
} else if (!ray_pnprocs) { /* immediate mode */ |
| 211 |
> |
ray_trace(&thisray); |
| 212 |
> |
} else { /* queuing mode */ |
| 213 |
> |
int rval; |
| 214 |
|
rayorigin(&thisray, PRIMARY, NULL, NULL); |
| 215 |
< |
samplendx++; |
| 216 |
< |
rayvalue(&thisray); |
| 215 |
> |
thisray.rno = (RNUMBER)p; |
| 216 |
> |
rval = ray_pqueue(&thisray); |
| 217 |
> |
if (!rval) |
| 218 |
> |
return(0); |
| 219 |
> |
if (rval < 0) |
| 220 |
> |
return(-1); |
| 221 |
> |
/* get node for returned ray */ |
| 222 |
> |
p = (PNODE *)thisray.rno; |
| 223 |
|
} |
| 224 |
|
|
| 174 |
– |
p->x = h; |
| 175 |
– |
p->y = v; |
| 225 |
|
copycolor(p->v, thisray.rcol); |
| 226 |
|
scalecolor(p->v, exposure); |
| 227 |
|
|
| 228 |
< |
(*dev->paintr)(greyscale?greyof(p->v):p->v, xmin, ymin, xmax, ymax); |
| 228 |
> |
recolor(p); /* paint it */ |
| 229 |
|
|
| 230 |
< |
if (dev->flush != NULL && nrays - lastflush >= WFLUSH) { |
| 231 |
< |
lastflush = nrays; |
| 232 |
< |
(*dev->flush)(); |
| 230 |
> |
if (dev->flush != NULL) { /* shall we check for input? */ |
| 231 |
> |
static RNUMBER lastflush = 0; |
| 232 |
> |
RNUMBER counter = raynum; |
| 233 |
> |
int flushintvl; |
| 234 |
> |
if (!ray_pnprocs) { |
| 235 |
> |
counter = nrays; |
| 236 |
> |
flushintvl = WFLUSH1; |
| 237 |
> |
} else if (ambounce == 0) |
| 238 |
> |
flushintvl = ray_pnprocs*WFLUSH; |
| 239 |
> |
else if (niflush < WFLUSH) |
| 240 |
> |
flushintvl = ray_pnprocs*niflush/(ambounce*(ambounce>0)+1); |
| 241 |
> |
else |
| 242 |
> |
flushintvl = ray_pnprocs*WFLUSH/(ambounce*(ambounce>0)+1); |
| 243 |
> |
if (lastflush > counter) |
| 244 |
> |
lastflush = 0; /* counter wrapped */ |
| 245 |
> |
|
| 246 |
> |
if (counter - lastflush >= flushintvl) { |
| 247 |
> |
lastflush = counter; |
| 248 |
> |
(*dev->flush)(); |
| 249 |
> |
niflush++; |
| 250 |
> |
} |
| 251 |
|
} |
| 252 |
+ |
return(1); |
| 253 |
|
} |
| 254 |
|
|
| 255 |
|
|
| 256 |
+ |
int |
| 257 |
+ |
waitrays(void) /* finish up pending rays */ |
| 258 |
+ |
{ |
| 259 |
+ |
int nwaited = 0; |
| 260 |
+ |
int rval; |
| 261 |
+ |
RAY raydone; |
| 262 |
+ |
|
| 263 |
+ |
if (!ray_pnprocs) /* immediate mode? */ |
| 264 |
+ |
return(0); |
| 265 |
+ |
while ((rval = ray_presult(&raydone, 0)) > 0) { |
| 266 |
+ |
PNODE *p = (PNODE *)raydone.rno; |
| 267 |
+ |
copycolor(p->v, raydone.rcol); |
| 268 |
+ |
scalecolor(p->v, exposure); |
| 269 |
+ |
recolor(p); |
| 270 |
+ |
nwaited++; |
| 271 |
+ |
} |
| 272 |
+ |
if (rval < 0) |
| 273 |
+ |
return(-1); |
| 274 |
+ |
return(nwaited); |
| 275 |
+ |
} |
| 276 |
+ |
|
| 277 |
+ |
|
| 278 |
|
void |
| 279 |
< |
newimage() /* start a new image */ |
| 279 |
> |
newimage( /* start a new image */ |
| 280 |
> |
char *s |
| 281 |
> |
) |
| 282 |
|
{ |
| 283 |
+ |
int newnp = 0; |
| 284 |
+ |
/* # rendering procs arg? */ |
| 285 |
+ |
if (s != NULL) |
| 286 |
+ |
sscanf(s, "%d", &newnp); |
| 287 |
|
/* free old image */ |
| 288 |
|
freepkids(&ptrunk); |
| 193 |
– |
/* save reserve memory */ |
| 194 |
– |
fillreserves(); |
| 289 |
|
/* compute resolution */ |
| 290 |
|
hresolu = dev->xsiz; |
| 291 |
|
vresolu = dev->ysiz; |
| 292 |
|
normaspect(viewaspect(&ourview), &dev->pixaspect, &hresolu, &vresolu); |
| 293 |
< |
pframe.l = pframe.d = 0; |
| 294 |
< |
pframe.r = hresolu; pframe.u = vresolu; |
| 293 |
> |
ptrunk.xmin = ptrunk.ymin = pframe.l = pframe.d = 0; |
| 294 |
> |
ptrunk.xmax = pframe.r = hresolu; |
| 295 |
> |
ptrunk.ymax = pframe.u = vresolu; |
| 296 |
|
pdepth = 0; |
| 297 |
|
/* clear device */ |
| 298 |
|
(*dev->clear)(hresolu, vresolu); |
| 299 |
< |
/* get first value */ |
| 300 |
< |
paint(&ptrunk, 0, 0, hresolu, vresolu); |
| 299 |
> |
|
| 300 |
> |
if (newparam) { /* (re)start rendering procs */ |
| 301 |
> |
if (ray_pnprocs) |
| 302 |
> |
ray_pclose(0); /* should already be closed */ |
| 303 |
> |
if (newnp > 0) |
| 304 |
> |
nproc = newnp; |
| 305 |
> |
if (nproc > 1) |
| 306 |
> |
ray_popen(nproc); |
| 307 |
> |
newparam = 0; |
| 308 |
> |
} else if ((newnp > 0) & (newnp != nproc)) { |
| 309 |
> |
if (newnp == 1) /* change # rendering procs */ |
| 310 |
> |
ray_pclose(0); |
| 311 |
> |
else if (newnp < ray_pnprocs) |
| 312 |
> |
ray_pclose(ray_pnprocs - newnp); |
| 313 |
> |
else |
| 314 |
> |
ray_popen(newnp - ray_pnprocs); |
| 315 |
> |
nproc = newnp; |
| 316 |
> |
} |
| 317 |
> |
niflush = 0; /* get first value */ |
| 318 |
> |
paint(&ptrunk); |
| 319 |
|
} |
| 320 |
|
|
| 321 |
|
|
| 322 |
|
void |
| 323 |
< |
redraw() /* redraw the image */ |
| 323 |
> |
redraw(void) /* redraw the image */ |
| 324 |
|
{ |
| 325 |
|
(*dev->clear)(hresolu, vresolu); |
| 326 |
|
(*dev->comout)("redrawing...\n"); |
| 330 |
|
|
| 331 |
|
|
| 332 |
|
void |
| 333 |
< |
repaint(xmin, ymin, xmax, ymax) /* repaint a region */ |
| 334 |
< |
int xmin, ymin, xmax, ymax; |
| 333 |
> |
repaint( /* repaint a region */ |
| 334 |
> |
int xmin, |
| 335 |
> |
int ymin, |
| 336 |
> |
int xmax, |
| 337 |
> |
int ymax |
| 338 |
> |
) |
| 339 |
|
{ |
| 340 |
|
RECT reg; |
| 341 |
|
|
| 342 |
|
reg.l = xmin; reg.r = xmax; |
| 343 |
|
reg.d = ymin; reg.u = ymax; |
| 344 |
|
|
| 345 |
< |
paintrect(&ptrunk, 0, 0, hresolu, vresolu, ®); |
| 345 |
> |
paintrect(&ptrunk, ®); |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
|
| 349 |
|
void |
| 350 |
< |
paintrect(p, xmin, ymin, xmax, ymax, r) /* paint picture rectangle */ |
| 351 |
< |
register PNODE *p; |
| 352 |
< |
int xmin, ymin, xmax, ymax; |
| 353 |
< |
register RECT *r; |
| 350 |
> |
paintrect( /* paint picture rectangle */ |
| 351 |
> |
PNODE *p, |
| 352 |
> |
RECT *r |
| 353 |
> |
) |
| 354 |
|
{ |
| 355 |
|
int mx, my; |
| 356 |
|
|
| 357 |
< |
if (xmax - xmin <= 0 || ymax - ymin <= 0) |
| 357 |
> |
if (p->xmax - p->xmin <= 0 || p->ymax - p->ymin <= 0) |
| 358 |
|
return; |
| 359 |
|
|
| 360 |
|
if (p->kid == NULL) { |
| 361 |
|
(*dev->paintr)(greyscale?greyof(p->v):p->v, |
| 362 |
< |
xmin, ymin, xmax, ymax); /* do this */ |
| 362 |
> |
p->xmin, p->ymin, p->xmax, p->ymax); /* do this */ |
| 363 |
|
return; |
| 364 |
|
} |
| 365 |
< |
mx = (xmin + xmax) >> 1; /* do kids */ |
| 366 |
< |
my = (ymin + ymax) >> 1; |
| 365 |
> |
mx = (p->xmin + p->xmax) >> 1; /* do kids */ |
| 366 |
> |
my = (p->ymin + p->ymax) >> 1; |
| 367 |
|
if (mx > r->l) { |
| 368 |
|
if (my > r->d) |
| 369 |
< |
paintrect(p->kid+DL, xmin, ymin, mx, my, r); |
| 369 |
> |
paintrect(p->kid+DL, r); |
| 370 |
|
if (my < r->u) |
| 371 |
< |
paintrect(p->kid+UL, xmin, my, mx, ymax, r); |
| 371 |
> |
paintrect(p->kid+UL, r); |
| 372 |
|
} |
| 373 |
|
if (mx < r->r) { |
| 374 |
|
if (my > r->d) |
| 375 |
< |
paintrect(p->kid+DR, mx, ymin, xmax, my, r); |
| 375 |
> |
paintrect(p->kid+DR, r); |
| 376 |
|
if (my < r->u) |
| 377 |
< |
paintrect(p->kid+UR, mx, my, xmax, ymax, r); |
| 377 |
> |
paintrect(p->kid+UR, r); |
| 378 |
|
} |
| 379 |
|
} |
| 380 |
|
|
| 381 |
|
|
| 382 |
|
PNODE * |
| 383 |
< |
findrect(x, y, p, r, pd) /* find a rectangle */ |
| 384 |
< |
int x, y; |
| 385 |
< |
register PNODE *p; |
| 386 |
< |
register RECT *r; |
| 387 |
< |
int pd; |
| 383 |
> |
findrect( /* find a rectangle */ |
| 384 |
> |
int x, |
| 385 |
> |
int y, |
| 386 |
> |
PNODE *p, |
| 387 |
> |
int pd |
| 388 |
> |
) |
| 389 |
|
{ |
| 390 |
|
int mx, my; |
| 391 |
|
|
| 392 |
|
while (p->kid != NULL && pd--) { |
| 393 |
|
|
| 394 |
< |
mx = (r->l + r->r) >> 1; |
| 395 |
< |
my = (r->d + r->u) >> 1; |
| 394 |
> |
mx = (p->xmin + p->xmax) >> 1; |
| 395 |
> |
my = (p->ymin + p->ymax) >> 1; |
| 396 |
|
|
| 397 |
|
if (x < mx) { |
| 280 |
– |
r->r = mx; |
| 398 |
|
if (y < my) { |
| 282 |
– |
r->u = my; |
| 399 |
|
p = p->kid+DL; |
| 400 |
|
} else { |
| 285 |
– |
r->d = my; |
| 401 |
|
p = p->kid+UL; |
| 402 |
|
} |
| 403 |
|
} else { |
| 289 |
– |
r->l = mx; |
| 404 |
|
if (y < my) { |
| 291 |
– |
r->u = my; |
| 405 |
|
p = p->kid+DR; |
| 406 |
|
} else { |
| 294 |
– |
r->d = my; |
| 407 |
|
p = p->kid+UR; |
| 408 |
|
} |
| 409 |
|
} |
| 413 |
|
|
| 414 |
|
|
| 415 |
|
void |
| 416 |
< |
scalepict(p, sf) /* scale picture values */ |
| 417 |
< |
register PNODE *p; |
| 418 |
< |
double sf; |
| 416 |
> |
compavg( /* recompute averages */ |
| 417 |
> |
PNODE *p |
| 418 |
> |
) |
| 419 |
|
{ |
| 420 |
+ |
int i, navg; |
| 421 |
+ |
|
| 422 |
+ |
if (p->kid == NULL) |
| 423 |
+ |
return; |
| 424 |
+ |
|
| 425 |
+ |
setcolor(p->v, .0, .0, .0); |
| 426 |
+ |
navg = 0; |
| 427 |
+ |
for (i = 0; i < 4; i++) { |
| 428 |
+ |
if (p->kid[i].xmin >= p->kid[i].xmax) continue; |
| 429 |
+ |
if (p->kid[i].ymin >= p->kid[i].ymax) continue; |
| 430 |
+ |
compavg(p->kid+i); |
| 431 |
+ |
addcolor(p->v, p->kid[i].v); |
| 432 |
+ |
navg++; |
| 433 |
+ |
} |
| 434 |
+ |
if (navg > 1) |
| 435 |
+ |
scalecolor(p->v, 1./navg); |
| 436 |
+ |
} |
| 437 |
+ |
|
| 438 |
+ |
|
| 439 |
+ |
void |
| 440 |
+ |
scalepict( /* scale picture values */ |
| 441 |
+ |
PNODE *p, |
| 442 |
+ |
double sf |
| 443 |
+ |
) |
| 444 |
+ |
{ |
| 445 |
|
scalecolor(p->v, sf); /* do this node */ |
| 446 |
|
|
| 447 |
|
if (p->kid == NULL) |
| 455 |
|
|
| 456 |
|
|
| 457 |
|
void |
| 458 |
< |
getpictcolrs(yoff, scan, p, xsiz, ysiz) /* get scanline from picture */ |
| 459 |
< |
int yoff; |
| 460 |
< |
register COLR *scan; |
| 461 |
< |
register PNODE *p; |
| 462 |
< |
int xsiz, ysiz; |
| 458 |
> |
getpictcolrs( /* get scanline from picture */ |
| 459 |
> |
int yoff, |
| 460 |
> |
COLR *scan, |
| 461 |
> |
PNODE *p, |
| 462 |
> |
int xsiz, |
| 463 |
> |
int ysiz |
| 464 |
> |
) |
| 465 |
|
{ |
| 466 |
< |
register int mx; |
| 466 |
> |
int mx; |
| 467 |
|
int my; |
| 468 |
|
|
| 469 |
|
if (p->kid == NULL) { /* do this node */ |
| 488 |
|
|
| 489 |
|
|
| 490 |
|
void |
| 491 |
< |
freepkids(p) /* free pnode's children */ |
| 492 |
< |
register PNODE *p; |
| 491 |
> |
freepkids( /* free pnode's children */ |
| 492 |
> |
PNODE *p |
| 493 |
> |
) |
| 494 |
|
{ |
| 495 |
|
if (p->kid == NULL) |
| 496 |
|
return; |
| 504 |
|
|
| 505 |
|
|
| 506 |
|
void |
| 507 |
< |
newview(vp) /* change viewing parameters */ |
| 508 |
< |
register VIEW *vp; |
| 507 |
> |
newview( /* change viewing parameters */ |
| 508 |
> |
VIEW *vp |
| 509 |
> |
) |
| 510 |
|
{ |
| 511 |
|
char *err; |
| 512 |
|
|
| 516 |
|
} else if (memcmp((char *)vp, (char *)&ourview, sizeof(VIEW))) { |
| 517 |
|
oldview = ourview; |
| 518 |
|
ourview = *vp; |
| 519 |
< |
newimage(); |
| 519 |
> |
newimage(NULL); |
| 520 |
|
} |
| 521 |
|
} |
| 522 |
|
|
| 523 |
|
|
| 524 |
|
void |
| 525 |
< |
moveview(angle, elev, mag, vc) /* move viewpoint */ |
| 526 |
< |
double angle, elev, mag; |
| 527 |
< |
FVECT vc; |
| 525 |
> |
moveview( /* move viewpoint */ |
| 526 |
> |
double angle, |
| 527 |
> |
double elev, |
| 528 |
> |
double mag, |
| 529 |
> |
FVECT vc |
| 530 |
> |
) |
| 531 |
|
{ |
| 532 |
|
double d; |
| 389 |
– |
FVECT v1; |
| 533 |
|
VIEW nv = ourview; |
| 534 |
< |
register int i; |
| 534 |
> |
int i; |
| 535 |
|
|
| 536 |
|
spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.)); |
| 537 |
< |
if (elev != 0.0) { |
| 538 |
< |
fcross(v1, ourview.vup, nv.vdir); |
| 539 |
< |
normalize(v1); |
| 397 |
< |
spinvector(nv.vdir, nv.vdir, v1, elev*(PI/180.)); |
| 398 |
< |
} |
| 537 |
> |
if (elev != 0.0) |
| 538 |
> |
geodesic(nv.vdir, nv.vdir, nv.vup, elev*(-PI/180.), GEOD_RAD); |
| 539 |
> |
|
| 540 |
|
if (nv.type == VT_PAR) { |
| 541 |
|
nv.horiz /= mag; |
| 542 |
|
nv.vert /= mag; |
| 562 |
|
|
| 563 |
|
|
| 564 |
|
void |
| 565 |
< |
pcopy(p1, p2) /* copy paint node p1 into p2 */ |
| 566 |
< |
register PNODE *p1, *p2; |
| 565 |
> |
pcopy( /* copy paint node p1 into p2 */ |
| 566 |
> |
PNODE *p1, |
| 567 |
> |
PNODE *p2 |
| 568 |
> |
) |
| 569 |
|
{ |
| 570 |
|
copycolor(p2->v, p1->v); |
| 571 |
|
p2->x = p1->x; |
| 574 |
|
|
| 575 |
|
|
| 576 |
|
void |
| 577 |
< |
zoomview(vp, zf) /* zoom in or out */ |
| 578 |
< |
register VIEW *vp; |
| 579 |
< |
double zf; |
| 577 |
> |
zoomview( /* zoom in or out */ |
| 578 |
> |
VIEW *vp, |
| 579 |
> |
double zf |
| 580 |
> |
) |
| 581 |
|
{ |
| 582 |
|
switch (vp->type) { |
| 583 |
|
case VT_PAR: /* parallel view */ |