--- ray/src/rt/rview.c 1989/10/25 15:37:19 1.7 +++ ray/src/rt/rview.c 1990/01/08 13:38:12 1.9 @@ -20,7 +20,8 @@ static char SCCSid[] = "$SunId$ LBL"; #include -VIEW ourview = STDVIEW(470); /* viewing parameters */ +VIEW ourview = STDVIEW; /* viewing parameters */ +int hresolu, vresolu; /* image resolution */ int psample = 8; /* pixel sample size */ double maxdiff = .15; /* max. sample difference */ @@ -114,20 +115,19 @@ rview() /* do a view */ newimage(); /* set up image */ for ( ; ; ) { /* quit in command() */ - while (ourview.hresolu <= 1<comout)(buf); rsample(); } else { sprintf(buf, "%d refining...\n", 1<comout)(buf); - refine(&ptrunk, 0, 0, ourview.hresolu, - ourview.vresolu, pdepth+1); + refine(&ptrunk, 0, 0, hresolu, vresolu, pdepth+1); } if (dev->inpready) command(": "); @@ -198,9 +198,13 @@ again: goto commerr; getmove(args); break; - case 'r': /* rotate camera */ - if (badcom("rotate")) - goto commerr; + case 'r': /* rotate/repaint */ + if (badcom("rotate")) { + if (badcom("repaint")) + goto commerr; + getrepaint(args); + break; + } getrotate(args); break; case 'p': /* pivot view */ @@ -262,10 +266,8 @@ rsample() /* sample the image */ * difference, we subsample the super-pixels. The testing process * includes initialization of the next row. */ - xsiz = (((pframe.r-pframe.l)<>pdepth), + rl[x].r = hresolu; rl[x].u = vresolu; + pl[x] = findrect(pframe.l+((x*hresolu)>>pdepth), pframe.d, &ptrunk, rl+x, pdepth); } /* sample the image */ @@ -307,9 +309,9 @@ rsample() /* sample the image */ * Find super-pixel at this position in next row. */ r.l = r.d = 0; - r.r = ourview.hresolu; r.u = ourview.vresolu; - p = findrect(pframe.l+((x*ourview.hresolu)>>pdepth), - pframe.d+(((y+1)*ourview.vresolu)>>pdepth), + r.r = hresolu; r.u = vresolu; + p = findrect(pframe.l+((x*hresolu)>>pdepth), + pframe.d+(((y+1)*vresolu)>>pdepth), &ptrunk, &r, pdepth); /* * Test super-pixel in next row.