ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rv2.c
(Generate patch)

Comparing ray/src/rt/rv2.c (file contents):
Revision 1.3 by greg, Fri Mar 3 18:34:33 1989 UTC vs.
Revision 1.5 by greg, Wed Jun 7 08:35:26 1989 UTC

# Line 265 | Line 265 | char  *s;
265  
266          if (getinterest(s, 0, vc, &mag) < 0)
267                  return;
268 <        moveview(0.0, mag, vc);
268 >        moveview(0.0, 0.0, mag, vc);
269   }
270  
271  
272   getrotate(s)                            /* rotate camera */
273   char  *s;
274   {
275 <        extern double  normalize();
275 >        extern double  normalize(), tan(), atan();
276          VIEW  nv;
277          FVECT  v1;
278 <        double  angle, elev;
278 >        double  angle, elev, zfact;
279          
280 <        elev = 0.0;
281 <        if (sscanf(s, "%lf %lf", &angle, &elev) < 1) {
280 >        elev = 0.0; zfact = 1.0;
281 >        if (sscanf(s, "%lf %lf %lf", &angle, &elev, &zfact) < 1) {
282                  error(COMMAND, "missing angle");
283                  return;
284          }
285        nv.type = ourview.type;
285          VCOPY(nv.vp, ourview.vp);
286          VCOPY(nv.vup, ourview.vup);
288        nv.horiz = ourview.horiz; nv.vert = ourview.vert;
287          nv.hresolu = ourview.hresolu; nv.vresolu = ourview.vresolu;
288          spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.));
289          if (elev != 0.0) {
# Line 293 | Line 291 | char  *s;
291                  normalize(v1);
292                  spinvector(nv.vdir, nv.vdir, v1, elev*(PI/180.));
293          }
294 +        if ((nv.type = ourview.type) == VT_PAR) {
295 +                nv.horiz = ourview.horiz / zfact;
296 +                nv.vert = ourview.vert / zfact;
297 +        } else {
298 +                nv.horiz = atan(tan(ourview.horiz*(PI/180./2.))/zfact) /
299 +                                (PI/180./2.);
300 +                nv.vert = atan(tan(ourview.vert*(PI/180./2.))/zfact) /
301 +                                (PI/180./2.);
302 +        }
303          newview(&nv);
304   }
305  
# Line 301 | Line 308 | getpivot(s)                            /* pivot viewpoint */
308   register char  *s;
309   {
310          FVECT  vc;
311 <        double  angle, mag;
311 >        double  angle, elev, mag;
312  
313 <        if (sscanf(s, "%lf", &angle) != 1) {
313 >        elev = 0.0;
314 >        if (sscanf(s, "%lf %lf", &angle, &elev) < 1) {
315                  error(COMMAND, "missing angle");
316                  return;
317          }
318 <        if (getinterest(sskip(s), 0, vc, &mag) < 0)
318 >        if (getinterest(sskip(sskip(s)), 0, vc, &mag) < 0)
319                  return;
320 <        moveview(angle, mag, vc);
320 >        moveview(angle, elev, mag, vc);
321   }
322  
323  
# Line 383 | Line 391 | register char  *s;
391          extern double  minweight;
392          extern int  maxdepth;
393          extern double  dstrsrc;
394 +        extern double  shadthresh;
395          extern COLOR  ambval;
396          extern double  ambacc;
397          extern double  minarad;
# Line 395 | Line 404 | register char  *s;
404          char  buf[128];
405          
406          if (s[0] == '\0') {
407 <                (*dev->comout)("aa ab ad ar as av ds lr lw sd sp: ");
407 >                (*dev->comout)("aa ab ad ar as av dj dt lr lw sd sp: ");
408                  (*dev->comin)(buf);
409                  s = buf;
410          }
# Line 428 | Line 437 | register char  *s;
437                          goto badparam;
438                  }
439                  break;
440 <        case 'd':                       /* distribute source */
441 <                if (s[1] != 's')
440 >        case 'd':                       /* direct */
441 >                switch (s[1]) {
442 >                case 'j':                       /* jitter */
443 >                        if (sscanf(s+2, "%lf", &d0) != 1) {
444 >                                sprintf(buf, "direct jitter (%.6g): ",
445 >                                                dstrsrc);
446 >                                (*dev->comout)(buf);
447 >                                (*dev->comin)(buf);
448 >                                if (sscanf(buf, "%lf", &d0) != 1)
449 >                                        break;
450 >                        }
451 >                        dstrsrc = d0;
452 >                        break;
453 >                case 't':                       /* threshold */
454 >                        if (sscanf(s+2, "%lf", &d0) != 1) {
455 >                                sprintf(buf, "direct threshold (%.6g): ",
456 >                                                shadthresh);
457 >                                (*dev->comout)(buf);
458 >                                (*dev->comin)(buf);
459 >                                if (sscanf(buf, "%lf", &d0) != 1)
460 >                                        break;
461 >                        }
462 >                        shadthresh = d0;
463 >                        break;
464 >                default:
465                          goto badparam;
434                if (sscanf(s+2, "%lf", &d0) != 1) {
435                        sprintf(buf, "distribute source (%.6g): ", dstrsrc);
436                        (*dev->comout)(buf);
437                        (*dev->comin)(buf);
438                        if (sscanf(buf, "%lf", &d0) != 1)
439                                break;
466                  }
441                dstrsrc = d0;
467                  break;
468          case 'a':                       /* ambient */
469                  switch (s[1]) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines