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

Comparing ray/src/rt/rv3.c (file contents):
Revision 1.17 by greg, Sun Oct 14 11:06:27 1990 UTC vs.
Revision 2.32 by greg, Sat Dec 12 00:03:42 2009 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1987 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  rv3.c - miscellaneous routines for rview.
6   *
7 < *     5/11/87
7 > *  External symbols declared in rpaint.h
8   */
9  
10 < #include  "ray.h"
10 > #include "copyright.h"
11  
12 < #include  "octree.h"
12 > #include <string.h>
13  
14 + #include  "ray.h"
15   #include  "rpaint.h"
18
16   #include  "random.h"
17  
18   #ifndef WFLUSH
19 < #define WFLUSH          30              /* flush after this many rays */
19 > #define WFLUSH          64              /* flush after this many primary rays */
20   #endif
21 + #ifndef WFLUSH1
22 + #define WFLUSH1         512             /* or this many total rays */
23 + #endif
24  
25  
26 < getrect(s, r)                           /* get a box */
27 < char  *s;
28 < register RECT  *r;
26 > #ifdef  SMLFLT
27 > #define  sscanvec(s,v)  (sscanf(s,"%f %f %f",v,v+1,v+2)==3)
28 > #else
29 > #define  sscanvec(s,v)  (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3)
30 > #endif
31 >
32 > static RNUMBER  niflush;                /* flushes since newimage() */
33 >
34 > int
35 > getrect(                                /* get a box */
36 >        char  *s,
37 >        RECT  *r
38 > )
39   {
40          int  x0, y0, x1, y1;
41  
# Line 69 | Line 79 | register RECT  *r;
79   }
80  
81  
82 < getinterest(s, direc, vec, mp)          /* get area of interest */
83 < char  *s;
84 < int  direc;
85 < FVECT  vec;
86 < double  *mp;
82 > int
83 > getinterest(            /* get area of interest */
84 >        char  *s,
85 >        int  direc,
86 >        FVECT  vec,
87 >        double  *mp
88 > )
89   {
90          int  x, y;
91          RAY  thisray;
92 <        register int  i;
92 >        int  i;
93  
94          if (sscanf(s, "%lf", mp) != 1)
95                  *mp = 1.0;
# Line 87 | Line 99 | double  *mp;
99                  error(COMMAND, "illegal magnification");
100                  return(-1);
101          }
102 <        if (sscanf(s, "%*lf %lf %lf %lf", &vec[0], &vec[1], &vec[2]) != 3) {
102 >        if (!sscanvec(sskip(s), vec)) {
103                  if (dev->getcur == NULL)
104                          return(-1);
105                  (*dev->comout)("Pick view center\n");
106                  if ((*dev->getcur)(&x, &y) == ABORT)
107                          return(-1);
108 <                if (viewray(thisray.rorg, thisray.rdir, &ourview,
109 <                                (x+.5)/hresolu, (y+.5)/vresolu) < 0) {
108 >                if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir,
109 >                        &ourview, (x+.5)/hresolu, (y+.5)/vresolu)) < -FTINY) {
110                          error(COMMAND, "not on image");
111                          return(-1);
112                  }
113                  if (!direc || ourview.type == VT_PAR) {
114 <                        rayorigin(&thisray, NULL, PRIMARY, 1.0);
114 >                        rayorigin(&thisray, PRIMARY, NULL, NULL);
115                          if (!localhit(&thisray, &thescene)) {
116                                  error(COMMAND, "not a local object");
117                                  return(-1);
# Line 113 | Line 125 | double  *mp;
125                                  VCOPY(vec, thisray.rdir);
126                  else
127                          VCOPY(vec, thisray.rop);
128 <        } else if (direc)
129 <                        for (i = 0; i < 3; i++)
130 <                                vec[i] -= ourview.vp[i];
128 >        } else if (direc) {
129 >                for (i = 0; i < 3; i++)
130 >                        vec[i] -= ourview.vp[i];
131 >                if (normalize(vec) == 0.0) {
132 >                        error(COMMAND, "point at view origin");
133 >                        return(-1);
134 >                }
135 >        }
136          return(0);
137   }
138  
139  
140   float *         /* keep consistent with COLOR typedef */
141 < greyof(col)                             /* convert color to greyscale */
142 < register COLOR  col;
141 > greyof(                         /* convert color to greyscale */
142 >        COLOR  col
143 > )
144   {
145          static COLOR  gcol;
146          double  b;
# Line 132 | Line 150 | register COLOR  col;
150          return(gcol);
151   }
152  
153 + static void
154 + recolor(                                        /* recolor the given node */
155 +        PNODE *p
156 + )
157 + {
158 +        while (p->kid != NULL) {                /* need to propogate down */
159 +                int  mx = (p->xmin + p->xmax) >> 1;
160 +                int  my = (p->ymin + p->ymax) >> 1;
161 +                int  ki;
162 +                if (p->x >= mx)
163 +                        ki = (p->y >= my) ? UR : DR;
164 +                else
165 +                        ki = (p->y >= my) ? UL : DL;
166 +                pcopy(p, p->kid+ki);
167 +                p = p->kid + ki;
168 +        }
169  
170 < paint(p, xmin, ymin, xmax, ymax)        /* compute and paint a rectangle */
171 < register PNODE  *p;
172 < int  xmin, ymin, xmax, ymax;
170 >        (*dev->paintr)(greyscale?greyof(p->v):p->v,
171 >                        p->xmin, p->ymin, p->xmax, p->ymax);
172 > }
173 >
174 > int
175 > paint(                  /* compute and paint a rectangle */
176 >        PNODE  *p
177 > )
178   {
140        extern long  nrays;
141        static long  lastflush = 0;
179          static RAY  thisray;
180          double  h, v;
181  
182 <        if (xmax - xmin <= 0 || ymax - ymin <= 0) {     /* empty */
183 <                p->x = xmin;
184 <                p->y = ymin;
182 >        if ((p->xmax <= p->xmin) | (p->ymax <= p->ymin)) {      /* empty */
183 >                p->x = p->xmin;
184 >                p->y = p->ymin;
185                  setcolor(p->v, 0.0, 0.0, 0.0);
186 <                return;
186 >                return(0);
187          }
188                                                  /* jitter ray direction */
189 <        h = xmin + (xmax-xmin)*frandom();
190 <        v = ymin + (ymax-ymin)*frandom();
189 >        p->x = h = p->xmin + (p->xmax-p->xmin)*frandom();
190 >        p->y = v = p->ymin + (p->ymax-p->ymin)*frandom();
191          
192 <        if (viewray(thisray.rorg, thisray.rdir, &ourview,
193 <                        h/hresolu, v/vresolu) < 0) {
192 >        if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, &ourview,
193 >                        h/hresolu, v/vresolu)) < -FTINY) {
194                  setcolor(thisray.rcol, 0.0, 0.0, 0.0);
195 <        } else {
196 <                rayorigin(&thisray, NULL, PRIMARY, 1.0);
197 <                rayvalue(&thisray);
195 >        } else if (nproc == 1) {                /* immediate mode */
196 >                ray_trace(&thisray);
197 >        } else {                                /* queuing mode */
198 >                int     rval;
199 >                rayorigin(&thisray, PRIMARY, NULL, NULL);
200 >                thisray.rno = (RNUMBER)p;
201 >                rval = ray_pqueue(&thisray);
202 >                if (!rval)
203 >                        return(0);
204 >                if (rval < 0)
205 >                        return(-1);
206 >                p = (PNODE *)thisray.rno;
207          }
208  
163        p->x = h;
164        p->y = v;
209          copycolor(p->v, thisray.rcol);
210          scalecolor(p->v, exposure);
211  
212 <        (*dev->paintr)(greyscale?greyof(p->v):p->v, xmin, ymin, xmax, ymax);
212 >        recolor(p);                             /* paint it */
213  
214 <        if (dev->flush != NULL && nrays - lastflush >= WFLUSH) {
215 <                lastflush = nrays;
216 <                (*dev->flush)();
214 >        if (dev->flush != NULL) {               /* shall we check for input? */
215 >                static RNUMBER  lastflush = 0;
216 >                RNUMBER         counter = raynum;
217 >                int             flushintvl;
218 >                if (nproc == 1) {
219 >                        counter = nrays;
220 >                        flushintvl = WFLUSH1;
221 >                } else if (ambounce == 0)
222 >                        flushintvl = nproc*WFLUSH;
223 >                else if (niflush < WFLUSH)
224 >                        flushintvl = nproc*niflush/(ambounce+1);
225 >                else
226 >                        flushintvl = nproc*WFLUSH/(ambounce+1);
227 >                if (lastflush > counter)
228 >                        lastflush = 0;          /* counter wrapped */
229 >
230 >                if (counter - lastflush >= flushintvl) {
231 >                        lastflush = counter;
232 >                        (*dev->flush)();
233 >                        niflush++;
234 >                }
235          }
236 +        return(1);
237   }
238  
239  
240 < newimage()                              /* start a new image */
240 > int
241 > waitrays(void)                                  /* finish up pending rays */
242   {
243 +        int     nwaited = 0;
244 +        int     rval;
245 +        RAY     raydone;
246 +
247 +        if (nproc <= 1)                         /* immediate mode? */
248 +                return(0);
249 +        while ((rval = ray_presult(&raydone, 0)) > 0) {
250 +                PNODE  *p = (PNODE *)raydone.rno;
251 +                copycolor(p->v, raydone.rcol);
252 +                scalecolor(p->v, exposure);
253 +                recolor(p);
254 +                nwaited++;
255 +        }
256 +        if (rval < 0)
257 +                return(-1);
258 +        return(nwaited);
259 + }
260 +
261 +
262 + void
263 + newimage(                                       /* start a new image */
264 +        char *s
265 + )
266 + {
267 +        extern int      ray_pnprocs;
268 +        int             newnp;
269 +                                                /* change in nproc? */
270 +        if (s != NULL && sscanf(s, "%d", &newnp) == 1 &&
271 +                        (newnp > 0) & (newnp != nproc)) {
272 +                if (!newparam) {
273 +                        if (newnp == 1)
274 +                                ray_pclose(0);
275 +                        else if (newnp < ray_pnprocs)
276 +                                ray_pclose(ray_pnprocs - newnp);
277 +                        else
278 +                                ray_popen(newnp - ray_pnprocs);
279 +                }
280 +                nproc = newnp;
281 +        }
282                                                  /* free old image */
283          freepkids(&ptrunk);
284                                                  /* compute resolution */
285          hresolu = dev->xsiz;
286          vresolu = dev->ysiz;
287          normaspect(viewaspect(&ourview), &dev->pixaspect, &hresolu, &vresolu);
288 <        pframe.l = pframe.d = 0;
289 <        pframe.r = hresolu; pframe.u = vresolu;
288 >        ptrunk.xmin = ptrunk.ymin = pframe.l = pframe.d = 0;
289 >        ptrunk.xmax = pframe.r = hresolu;
290 >        ptrunk.ymax = pframe.u = vresolu;
291          pdepth = 0;
292                                                  /* clear device */
293          (*dev->clear)(hresolu, vresolu);
294 <                                                /* get first value */
295 <        paint(&ptrunk, 0, 0, hresolu, vresolu);
294 >
295 >        if (newparam) {                         /* (re)start rendering procs */
296 >                if (ray_pnprocs > 0)
297 >                        ray_pclose(0);
298 >                if (nproc > 1)
299 >                        ray_popen(nproc);
300 >                newparam = 0;
301 >        }
302 >        niflush = 0;                            /* get first value */
303 >        paint(&ptrunk);
304   }
305  
306  
307 < redraw()                                /* redraw the image */
307 > void
308 > redraw(void)                            /* redraw the image */
309   {
310          (*dev->clear)(hresolu, vresolu);
311          (*dev->comout)("redrawing...\n");
# Line 201 | Line 314 | redraw()                               /* redraw the image */
314   }
315  
316  
317 < repaint(xmin, ymin, xmax, ymax)                 /* repaint a region */
318 < int  xmin, ymin, xmax, ymax;
317 > void
318 > repaint(                                /* repaint a region */
319 >        int  xmin,
320 >        int  ymin,
321 >        int  xmax,
322 >        int  ymax
323 > )
324   {
325          RECT  reg;
326  
327          reg.l = xmin; reg.r = xmax;
328          reg.d = ymin; reg.u = ymax;
329  
330 <        paintrect(&ptrunk, 0, 0, hresolu, vresolu, &reg);
330 >        paintrect(&ptrunk, &reg);
331   }
332  
333  
334 < paintrect(p, xmin, ymin, xmax, ymax, r)         /* paint picture rectangle */
335 < register PNODE  *p;
336 < int  xmin, ymin, xmax, ymax;
337 < register RECT  *r;
334 > void
335 > paintrect(                              /* paint picture rectangle */
336 >        PNODE  *p,
337 >        RECT  *r
338 > )
339   {
340          int  mx, my;
341  
342 <        if (xmax - xmin <= 0 || ymax - ymin <= 0)
342 >        if (p->xmax - p->xmin <= 0 || p->ymax - p->ymin <= 0)
343                  return;
344  
345          if (p->kid == NULL) {
346                  (*dev->paintr)(greyscale?greyof(p->v):p->v,
347 <                                xmin, ymin, xmax, ymax);        /* do this */
347 >                        p->xmin, p->ymin, p->xmax, p->ymax);    /* do this */
348                  return;
349          }
350 <        mx = (xmin + xmax) >> 1;                                /* do kids */
351 <        my = (ymin + ymax) >> 1;
350 >        mx = (p->xmin + p->xmax) >> 1;                          /* do kids */
351 >        my = (p->ymin + p->ymax) >> 1;
352          if (mx > r->l) {
353                  if (my > r->d)
354 <                        paintrect(p->kid+DL, xmin, ymin, mx, my, r);
354 >                        paintrect(p->kid+DL, r);
355                  if (my < r->u)
356 <                        paintrect(p->kid+UL, xmin, my, mx, ymax, r);
356 >                        paintrect(p->kid+UL, r);
357          }
358          if (mx < r->r) {
359                  if (my > r->d)
360 <                        paintrect(p->kid+DR, mx, ymin, xmax, my, r);
360 >                        paintrect(p->kid+DR, r);
361                  if (my < r->u)
362 <                        paintrect(p->kid+UR, mx, my, xmax, ymax, r);
362 >                        paintrect(p->kid+UR, r);
363          }
364   }
365  
366  
367   PNODE *
368 < findrect(x, y, p, r, pd)                /* find a rectangle */
369 < int  x, y;
370 < register PNODE  *p;
371 < register RECT  *r;
372 < int  pd;
368 > findrect(                               /* find a rectangle */
369 >        int  x,
370 >        int  y,
371 >        PNODE  *p,
372 >        int  pd
373 > )
374   {
375          int  mx, my;
376  
377          while (p->kid != NULL && pd--) {
378  
379 <                mx = (r->l + r->r) >> 1;
380 <                my = (r->d + r->u) >> 1;
379 >                mx = (p->xmin + p->xmax) >> 1;
380 >                my = (p->ymin + p->ymax) >> 1;
381  
382                  if (x < mx) {
263                        r->r = mx;
383                          if (y < my) {
265                                r->u = my;
384                                  p = p->kid+DL;
385                          } else {
268                                r->d = my;
386                                  p = p->kid+UL;
387                          }
388                  } else {
272                        r->l = mx;
389                          if (y < my) {
274                                r->u = my;
390                                  p = p->kid+DR;
391                          } else {
277                                r->d = my;
392                                  p = p->kid+UR;
393                          }
394                  }
# Line 283 | Line 397 | int  pd;
397   }
398  
399  
400 < scalepict(p, sf)                        /* scale picture values */
401 < register PNODE  *p;
402 < double  sf;
400 > void
401 > compavg(                                /* recompute averages */
402 >        PNODE   *p
403 > )
404   {
405 +        int     i, navg;
406 +        
407 +        if (p->kid == NULL)
408 +                return;
409 +
410 +        setcolor(p->v, .0, .0, .0);
411 +        navg = 0;
412 +        for (i = 0; i < 4; i++) {
413 +                if (p->kid[i].xmin >= p->kid[i].xmax) continue;
414 +                if (p->kid[i].ymin >= p->kid[i].ymax) continue;
415 +                compavg(p->kid+i);
416 +                addcolor(p->v, p->kid[i].v);
417 +                navg++;
418 +        }
419 +        if (navg > 1)
420 +                scalecolor(p->v, 1./navg);
421 + }
422 +
423 +
424 + void
425 + scalepict(                              /* scale picture values */
426 +        PNODE  *p,
427 +        double  sf
428 + )
429 + {
430          scalecolor(p->v, sf);           /* do this node */
431  
432          if (p->kid == NULL)
# Line 299 | Line 439 | double  sf;
439   }
440  
441  
442 < getpictcolrs(yoff, scan, p, xsiz, ysiz) /* get scanline from picture */
443 < int  yoff;
444 < register COLR  *scan;
445 < register PNODE  *p;
446 < int  xsiz, ysiz;
442 > void
443 > getpictcolrs(                           /* get scanline from picture */
444 >        int  yoff,
445 >        COLR  *scan,
446 >        PNODE  *p,
447 >        int  xsiz,
448 >        int  ysiz
449 > )
450   {
451 <        register int  mx;
451 >        int  mx;
452          int  my;
453  
454          if (p->kid == NULL) {                   /* do this node */
# Line 329 | Line 472 | int  xsiz, ysiz;
472   }
473  
474  
475 < pcopy(p1, p2)                           /* copy paint node p1 into p2 */
476 < register PNODE  *p1, *p2;
475 > void
476 > freepkids(                              /* free pnode's children */
477 >        PNODE  *p
478 > )
479   {
335        copycolor(p2->v, p1->v);
336        p2->x = p1->x;
337        p2->y = p1->y;
338 }
339
340
341 freepkids(p)                            /* free pnode's children */
342 register PNODE  *p;
343 {
480          if (p->kid == NULL)
481                  return;
482          freepkids(p->kid+DL);
483          freepkids(p->kid+DR);
484          freepkids(p->kid+UL);
485          freepkids(p->kid+UR);
486 <        free((char *)p->kid);
486 >        free((void *)p->kid);
487          p->kid = NULL;
488   }
489  
490  
491 < newview(vp)                             /* change viewing parameters */
492 < register VIEW  *vp;
491 > void
492 > newview(                                        /* change viewing parameters */
493 >        VIEW  *vp
494 > )
495   {
496          char  *err;
497  
498          if ((err = setview(vp)) != NULL) {
499                  sprintf(errmsg, "view not set - %s", err);
500                  error(COMMAND, errmsg);
501 <        } else if (bcmp((char *)vp, (char *)&ourview, sizeof(VIEW))) {
502 <                copystruct(&oldview, &ourview);
503 <                copystruct(&ourview, vp);
504 <                newimage();
501 >        } else if (memcmp((char *)vp, (char *)&ourview, sizeof(VIEW))) {
502 >                oldview = ourview;
503 >                ourview = *vp;
504 >                newimage(NULL);
505          }
506   }
507  
508  
509 < moveview(angle, elev, mag, vc)                  /* move viewpoint */
510 < double  angle, elev, mag;
511 < FVECT  vc;
509 > void
510 > moveview(                                       /* move viewpoint */
511 >        double  angle,
512 >        double  elev,
513 >        double  mag,
514 >        FVECT  vc
515 > )
516   {
375        extern double  sqrt(), dist2();
517          double  d;
518          FVECT  v1;
519 <        VIEW  nv;
520 <        register int  i;
519 >        VIEW  nv = ourview;
520 >        int  i;
521  
381        VCOPY(nv.vup, ourview.vup);
382        nv.hoff = ourview.hoff; nv.voff = ourview.voff;
522          spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.));
523          if (elev != 0.0) {
524                  fcross(v1, ourview.vup, nv.vdir);
525                  normalize(v1);
526                  spinvector(nv.vdir, nv.vdir, v1, elev*(PI/180.));
527          }
528 <        if ((nv.type = ourview.type) == VT_PAR) {
529 <                nv.horiz = ourview.horiz / mag;
530 <                nv.vert = ourview.vert / mag;
528 >        if (nv.type == VT_PAR) {
529 >                nv.horiz /= mag;
530 >                nv.vert /= mag;
531                  d = 0.0;                        /* don't move closer */
532                  for (i = 0; i < 3; i++)
533                          d += (vc[i] - ourview.vp[i])*ourview.vdir[i];
534          } else {
396                nv.horiz = ourview.horiz;
397                nv.vert = ourview.vert;
535                  d = sqrt(dist2(ourview.vp, vc)) / mag;
536 +                if (nv.vfore > FTINY) {
537 +                        nv.vfore += d - d*mag;
538 +                        if (nv.vfore < 0.0) nv.vfore = 0.0;
539 +                }
540 +                if (nv.vaft > FTINY) {
541 +                        nv.vaft += d - d*mag;
542 +                        if (nv.vaft <= nv.vfore) nv.vaft = 0.0;
543 +                }
544 +                nv.vdist /= mag;
545          }
546          for (i = 0; i < 3; i++)
547                  nv.vp[i] = vc[i] - d*nv.vdir[i];
# Line 403 | Line 549 | FVECT  vc;
549   }
550  
551  
552 < zoomview(vp, zf)                        /* zoom in our out */
553 < register VIEW  *vp;
554 < double  zf;
552 > void
553 > pcopy(                                  /* copy paint node p1 into p2 */
554 >        PNODE  *p1,
555 >        PNODE  *p2
556 > )
557   {
558 +        copycolor(p2->v, p1->v);
559 +        p2->x = p1->x;
560 +        p2->y = p1->y;
561 + }
562 +
563 +
564 + void
565 + zoomview(                               /* zoom in or out */
566 +        VIEW  *vp,
567 +        double  zf
568 + )
569 + {
570          switch (vp->type) {
571          case VT_PAR:                            /* parallel view */
572 +                vp->horiz /= zf;
573 +                vp->vert /= zf;
574 +                return;
575          case VT_ANG:                            /* angular fisheye */
576                  vp->horiz /= zf;
577 +                if (vp->horiz > 360.)
578 +                        vp->horiz = 360.;
579                  vp->vert /= zf;
580 +                if (vp->vert > 360.)
581 +                        vp->vert = 360.;
582                  return;
583 +        case VT_PLS:                            /* planisphere fisheye */
584 +                vp->horiz = sin((PI/180./2.)*vp->horiz) /
585 +                                (1.0 + cos((PI/180./2.)*vp->horiz)) / zf;
586 +                vp->horiz *= vp->horiz;
587 +                vp->horiz = (2.*180./PI)*acos((1. - vp->horiz) /
588 +                                                (1. + vp->horiz));
589 +                vp->vert = sin((PI/180./2.)*vp->vert) /
590 +                                (1.0 + cos((PI/180./2.)*vp->vert)) / zf;
591 +                vp->vert *= vp->vert;
592 +                vp->vert = (2.*180./PI)*acos((1. - vp->vert) /
593 +                                                (1. + vp->vert));
594 +                return;
595 +        case VT_CYL:                            /* cylindrical panorama */
596 +                vp->horiz /= zf;
597 +                if (vp->horiz > 360.)
598 +                        vp->horiz = 360.;
599 +                vp->vert = atan(tan(vp->vert*(PI/180./2.))/zf) / (PI/180./2.);
600 +                return;
601          case VT_PER:                            /* perspective view */
602                  vp->horiz = atan(tan(vp->horiz*(PI/180./2.))/zf) /
603                                  (PI/180./2.);
# Line 432 | Line 617 | double  zf;
617                          vp->vert = asin(vp->vert) / (PI/180./2.);
618                  return;
619          }
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;
620   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines