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.2 by greg, Wed Apr 5 09:38:12 1989 UTC vs.
Revision 2.24 by greg, Fri Aug 22 17:39:26 2008 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  "rpaint.h"
12 > #include <string.h>
13  
14 + #include  "ray.h"
15 + #include  "rpaint.h"
16   #include  "random.h"
17  
18 + #ifndef WFLUSH
19 + #define WFLUSH          64              /* flush after this many rays */
20 + #endif
21  
22 + #ifdef  SMLFLT
23 + #define  sscanvec(s,v)  (sscanf(s,"%f %f %f",v,v+1,v+2)==3)
24 + #else
25 + #define  sscanvec(s,v)  (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3)
26 + #endif
27 +
28 + static unsigned long  niflush;          /* flushes since newimage() */
29 +
30 + int
31 + getrect(                                /* get a box */
32 +        char  *s,
33 +        RECT  *r
34 + )
35 + {
36 +        int  x0, y0, x1, y1;
37 +
38 +        if (*s && !strncmp(s, "all", strlen(s))) {
39 +                r->l = r->d = 0;
40 +                r->r = hresolu;
41 +                r->u = vresolu;
42 +                return(0);
43 +        }
44 +        if (sscanf(s, "%d %d %d %d", &x0, &y0, &x1, &y1) != 4) {
45 +                if (dev->getcur == NULL)
46 +                        return(-1);
47 +                (*dev->comout)("Pick first corner\n");
48 +                if ((*dev->getcur)(&x0, &y0) == ABORT)
49 +                        return(-1);
50 +                (*dev->comout)("Pick second corner\n");
51 +                if ((*dev->getcur)(&x1, &y1) == ABORT)
52 +                        return(-1);
53 +        }
54 +        if (x0 < x1) {
55 +                r->l = x0;
56 +                r->r = x1;
57 +        } else {
58 +                r->l = x1;
59 +                r->r = x0;
60 +        }
61 +        if (y0 < y1) {
62 +                r->d = y0;
63 +                r->u = y1;
64 +        } else {
65 +                r->d = y1;
66 +                r->u = y0;
67 +        }
68 +        if (r->l < 0) r->l = 0;
69 +        if (r->d < 0) r->d = 0;
70 +        if (r->r > hresolu) r->r = hresolu;
71 +        if (r->u > vresolu) r->u = vresolu;
72 +        if (r->l > r->r) r->l = r->r;
73 +        if (r->d > r->u) r->d = r->u;
74 +        return(0);
75 + }
76 +
77 +
78 + int
79 + getinterest(            /* get area of interest */
80 +        char  *s,
81 +        int  direc,
82 +        FVECT  vec,
83 +        double  *mp
84 + )
85 + {
86 +        int  x, y;
87 +        RAY  thisray;
88 +        int  i;
89 +
90 +        if (sscanf(s, "%lf", mp) != 1)
91 +                *mp = 1.0;
92 +        else if (*mp < -FTINY)          /* negative zoom is reduction */
93 +                *mp = -1.0 / *mp;
94 +        else if (*mp <= FTINY) {        /* too small */
95 +                error(COMMAND, "illegal magnification");
96 +                return(-1);
97 +        }
98 +        if (!sscanvec(sskip(s), vec)) {
99 +                if (dev->getcur == NULL)
100 +                        return(-1);
101 +                (*dev->comout)("Pick view center\n");
102 +                if ((*dev->getcur)(&x, &y) == ABORT)
103 +                        return(-1);
104 +                if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir,
105 +                        &ourview, (x+.5)/hresolu, (y+.5)/vresolu)) < -FTINY) {
106 +                        error(COMMAND, "not on image");
107 +                        return(-1);
108 +                }
109 +                if (!direc || ourview.type == VT_PAR) {
110 +                        rayorigin(&thisray, PRIMARY, NULL, NULL);
111 +                        if (!localhit(&thisray, &thescene)) {
112 +                                error(COMMAND, "not a local object");
113 +                                return(-1);
114 +                        }
115 +                }
116 +                if (direc)
117 +                        if (ourview.type == VT_PAR)
118 +                                for (i = 0; i < 3; i++)
119 +                                        vec[i] = thisray.rop[i] - ourview.vp[i];
120 +                        else
121 +                                VCOPY(vec, thisray.rdir);
122 +                else
123 +                        VCOPY(vec, thisray.rop);
124 +        } else if (direc) {
125 +                for (i = 0; i < 3; i++)
126 +                        vec[i] -= ourview.vp[i];
127 +                if (normalize(vec) == 0.0) {
128 +                        error(COMMAND, "point at view origin");
129 +                        return(-1);
130 +                }
131 +        }
132 +        return(0);
133 + }
134 +
135 +
136   float *         /* keep consistent with COLOR typedef */
137 < greyof(col)                             /* convert color to greyscale */
138 < register COLOR  col;
137 > greyof(                         /* convert color to greyscale */
138 >        COLOR  col
139 > )
140   {
141          static COLOR  gcol;
142          double  b;
# Line 30 | Line 147 | register COLOR  col;
147   }
148  
149  
150 < paint(p, xmin, ymin, xmax, ymax)        /* compute and paint a rectangle */
151 < register PNODE  *p;
152 < int  xmin, ymin, xmax, ymax;
150 > int
151 > paint(                  /* compute and paint a rectangle */
152 >        PNODE  *p
153 > )
154   {
155 +        extern int  ray_pnprocs;
156 +        static unsigned long  lastflush = 0;
157          static RAY  thisray;
158 +        int     flushintvl;
159          double  h, v;
39        register int  i;
160  
161 <        if (xmax - xmin <= 0 || ymax - ymin <= 0) {     /* empty */
162 <                p->x = xmin;
163 <                p->y = ymin;
161 >        if (p->xmax - p->xmin <= 0 || p->ymax - p->ymin <= 0) { /* empty */
162 >                p->x = p->xmin;
163 >                p->y = p->ymin;
164                  setcolor(p->v, 0.0, 0.0, 0.0);
165 <                return;
165 >                return(0);
166          }
167                                                  /* jitter ray direction */
168 <        p->x = h = xmin + (xmax-xmin)*frandom();
169 <        p->y = v = ymin + (ymax-ymin)*frandom();
168 >        p->x = h = p->xmin + (p->xmax-p->xmin)*frandom();
169 >        p->y = v = p->ymin + (p->ymax-p->ymin)*frandom();
170          
171 <        rayview(thisray.rorg, thisray.rdir, &ourview, h, v);
171 >        if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, &ourview,
172 >                        h/hresolu, v/vresolu)) < -FTINY) {
173 >                setcolor(thisray.rcol, 0.0, 0.0, 0.0);
174 >        } else {
175 >                int  rval;
176 >                rayorigin(&thisray, PRIMARY, NULL, NULL);
177 >                thisray.rno = (unsigned long)p;
178 >                rval = ray_pqueue(&thisray);
179 >                if (!rval)
180 >                        return(0);
181 >                if (rval < 0)
182 >                        return(-1);
183 >                p = (PNODE *)thisray.rno;
184 >        }
185  
53        rayorigin(&thisray, NULL, PRIMARY, 1.0);
54        
55        rayvalue(&thisray);
56
186          copycolor(p->v, thisray.rcol);
58
187          scalecolor(p->v, exposure);
188  
189 <        (*dev->paintr)(greyscale?greyof(p->v):p->v, xmin, ymin, xmax, ymax);
189 >        (*dev->paintr)(greyscale?greyof(p->v):p->v,
190 >                        p->xmin, p->ymin, p->xmax, p->ymax);
191 >
192 >        if (ambounce <= 0)                      /* shall we check for input? */
193 >                flushintvl = ray_pnprocs*WFLUSH;
194 >        else if (niflush < WFLUSH)
195 >                flushintvl = ray_pnprocs*niflush/(ambounce+1);
196 >        else
197 >                flushintvl = ray_pnprocs*WFLUSH/(ambounce+1);
198 >
199 >        if (dev->flush != NULL && raynum - lastflush >= flushintvl) {
200 >                lastflush = raynum;
201 >                (*dev->flush)();
202 >                niflush++;
203 >        }
204 >        return(1);
205   }
206  
207  
208 < newimage()                              /* start a new image */
208 > int
209 > waitrays(void)                                  /* finish up pending rays */
210   {
211 +        int     nwaited = 0;
212 +        int     rval;
213 +        RAY     raydone;
214 +        
215 +        while ((rval = ray_presult(&raydone, 0)) > 0) {
216 +                PNODE  *p = (PNODE *)raydone.rno;
217 +                copycolor(p->v, raydone.rcol);
218 +                scalecolor(p->v, exposure);
219 +                (*dev->paintr)(greyscale?greyof(p->v):p->v,
220 +                                p->xmin, p->ymin, p->xmax, p->ymax);
221 +                nwaited++;
222 +        }
223 +        if (rval < 0)
224 +                return(-1);
225 +        return(nwaited);
226 + }
227 +
228 +
229 + void
230 + newimage(                                       /* start a new image */
231 +        char *s
232 + )
233 + {
234 +        int     newnp;
235 +                                                /* change in nproc? */
236 +        if (s != NULL && sscanf(s, "%d", &newnp) == 1 && newnp > 0) {
237 +                if (!newparam) {
238 +                        if (newnp < nproc)
239 +                                ray_pclose(nproc - newnp);
240 +                        else
241 +                                ray_popen(newnp - nproc);
242 +                }
243 +                nproc = newnp;
244 +        }
245                                                  /* free old image */
246          freepkids(&ptrunk);
247 <                                                /* set up frame */
248 <        if (ourview.hresolu > dev->xsiz || ourview.vresolu > dev->ysiz)
249 <                error(USER, "resolution mismatch");
250 <        pframe.l = pframe.d = 0;
251 <        pframe.r = ourview.hresolu; pframe.u = ourview.vresolu;
247 >                                                /* compute resolution */
248 >        hresolu = dev->xsiz;
249 >        vresolu = dev->ysiz;
250 >        normaspect(viewaspect(&ourview), &dev->pixaspect, &hresolu, &vresolu);
251 >        ptrunk.xmin = ptrunk.ymin = pframe.l = pframe.d = 0;
252 >        ptrunk.xmax = pframe.r = hresolu;
253 >        ptrunk.ymax = pframe.u = vresolu;
254          pdepth = 0;
255                                                  /* clear device */
256 <        (*dev->clear)(ourview.hresolu, ourview.vresolu);
257 <                                                /* get first value */
258 <        paint(&ptrunk, 0, 0, ourview.hresolu, ourview.vresolu);
256 >        (*dev->clear)(hresolu, vresolu);
257 >
258 >        if (newparam) {                         /* (re)start rendering procs */
259 >                ray_pclose(0);
260 >                ray_popen(nproc);
261 >                newparam = 0;
262 >        }
263 >        niflush = 0;                            /* get first value */
264 >        paint(&ptrunk);
265   }
266  
267  
268 < redraw()                                /* redraw the image */
268 > void
269 > redraw(void)                            /* redraw the image */
270   {
271 <        (*dev->clear)(ourview.hresolu, ourview.vresolu);
271 >        (*dev->clear)(hresolu, vresolu);
272          (*dev->comout)("redrawing...\n");
273 <        repaint(0, 0, ourview.hresolu, ourview.vresolu);
273 >        repaint(0, 0, hresolu, vresolu);
274          (*dev->comout)("\n");
275   }
276  
277  
278 < repaint(xmin, ymin, xmax, ymax)                 /* repaint a region */
279 < int  xmin, ymin, xmax, ymax;
278 > void
279 > repaint(                                /* repaint a region */
280 >        int  xmin,
281 >        int  ymin,
282 >        int  xmax,
283 >        int  ymax
284 > )
285   {
286          RECT  reg;
287  
288          reg.l = xmin; reg.r = xmax;
289          reg.d = ymin; reg.u = ymax;
290  
291 <        paintrect(&ptrunk, 0, 0, ourview.hresolu, ourview.vresolu, &reg);
291 >        paintrect(&ptrunk, &reg);
292   }
293  
294  
295 < paintrect(p, xmin, ymin, xmax, ymax, r)         /* paint picture rectangle */
296 < register PNODE  *p;
297 < int  xmin, ymin, xmax, ymax;
298 < register RECT  *r;
295 > void
296 > paintrect(                              /* paint picture rectangle */
297 >        PNODE  *p,
298 >        RECT  *r
299 > )
300   {
301          int  mx, my;
302  
303 <        if (dev->inpready)
111 <                return;                         /* break for input */
112 <
113 <        if (xmax - xmin <= 0 || ymax - ymin <= 0)
303 >        if (p->xmax - p->xmin <= 0 || p->ymax - p->ymin <= 0)
304                  return;
305  
306          if (p->kid == NULL) {
307                  (*dev->paintr)(greyscale?greyof(p->v):p->v,
308 <                                xmin, ymin, xmax, ymax);        /* do this */
308 >                        p->xmin, p->ymin, p->xmax, p->ymax);    /* do this */
309                  return;
310          }
311 <        mx = (xmin + xmax) >> 1;                                /* do kids */
312 <        my = (ymin + ymax) >> 1;
311 >        mx = (p->xmin + p->xmax) >> 1;                          /* do kids */
312 >        my = (p->ymin + p->ymax) >> 1;
313          if (mx > r->l) {
314                  if (my > r->d)
315 <                        paintrect(p->kid+DL, xmin, ymin, mx, my, r);
315 >                        paintrect(p->kid+DL, r);
316                  if (my < r->u)
317 <                        paintrect(p->kid+UL, xmin, my, mx, ymax, r);
317 >                        paintrect(p->kid+UL, r);
318          }
319          if (mx < r->r) {
320                  if (my > r->d)
321 <                        paintrect(p->kid+DR, mx, ymin, xmax, my, r);
321 >                        paintrect(p->kid+DR, r);
322                  if (my < r->u)
323 <                        paintrect(p->kid+UR, mx, my, xmax, ymax, r);
323 >                        paintrect(p->kid+UR, r);
324          }
325   }
326  
327  
328   PNODE *
329 < findrect(x, y, p, r, pd)                /* find a rectangle */
330 < int  x, y;
331 < register PNODE  *p;
332 < register RECT  *r;
333 < int  pd;
329 > findrect(                               /* find a rectangle */
330 >        int  x,
331 >        int  y,
332 >        PNODE  *p,
333 >        int  pd
334 > )
335   {
336          int  mx, my;
337  
338          while (p->kid != NULL && pd--) {
339  
340 <                mx = (r->l + r->r) >> 1;
341 <                my = (r->d + r->u) >> 1;
340 >                mx = (p->xmin + p->xmax) >> 1;
341 >                my = (p->ymin + p->ymax) >> 1;
342  
343                  if (x < mx) {
153                        r->r = mx;
344                          if (y < my) {
155                                r->u = my;
345                                  p = p->kid+DL;
346                          } else {
158                                r->d = my;
347                                  p = p->kid+UL;
348                          }
349                  } else {
162                        r->l = mx;
350                          if (y < my) {
164                                r->u = my;
351                                  p = p->kid+DR;
352                          } else {
167                                r->d = my;
353                                  p = p->kid+UR;
354                          }
355                  }
# Line 173 | Line 358 | int  pd;
358   }
359  
360  
361 < scalepict(p, sf)                        /* scale picture values */
362 < register PNODE  *p;
363 < double  sf;
361 > void
362 > scalepict(                              /* scale picture values */
363 >        PNODE  *p,
364 >        double  sf
365 > )
366   {
367          scalecolor(p->v, sf);           /* do this node */
368  
# Line 189 | Line 376 | double  sf;
376   }
377  
378  
379 < getpictcolrs(yoff, scan, p, xsiz, ysiz) /* get scanline from picture */
380 < int  yoff;
381 < register COLR  *scan;
382 < register PNODE  *p;
383 < int  xsiz, ysiz;
379 > void
380 > getpictcolrs(                           /* get scanline from picture */
381 >        int  yoff,
382 >        COLR  *scan,
383 >        PNODE  *p,
384 >        int  xsiz,
385 >        int  ysiz
386 > )
387   {
388 <        register int  mx;
388 >        int  mx;
389          int  my;
390  
391          if (p->kid == NULL) {                   /* do this node */
# Line 219 | Line 409 | int  xsiz, ysiz;
409   }
410  
411  
412 < pcopy(p1, p2)                           /* copy paint node p1 into p2 */
413 < register PNODE  *p1, *p2;
412 > void
413 > freepkids(                              /* free pnode's children */
414 >        PNODE  *p
415 > )
416   {
225        copycolor(p2->v, p1->v);
226        p2->x = p1->x;
227        p2->y = p1->y;
228 }
229
230
231 freepkids(p)                            /* free pnode's children */
232 register PNODE  *p;
233 {
417          if (p->kid == NULL)
418                  return;
419          freepkids(p->kid+DL);
420          freepkids(p->kid+DR);
421          freepkids(p->kid+UL);
422          freepkids(p->kid+UR);
423 <        free((char *)p->kid);
423 >        free((void *)p->kid);
424          p->kid = NULL;
425   }
426  
427  
428 < newview(vp)                             /* change viewing parameters */
429 < register VIEW  *vp;
428 > void
429 > newview(                                        /* change viewing parameters */
430 >        VIEW  *vp
431 > )
432   {
433          char  *err;
434  
435 <        if (vp->hresolu > dev->xsiz || vp->vresolu > dev->ysiz) {
251 <                error(COMMAND, "view not set - resolution mismatch");
252 <        } else if ((err = setview(vp)) != NULL) {
435 >        if ((err = setview(vp)) != NULL) {
436                  sprintf(errmsg, "view not set - %s", err);
437                  error(COMMAND, errmsg);
438 <        } else if (bcmp(vp, &ourview, sizeof(VIEW))) {
439 <                bcopy(&ourview, &oldview, sizeof(VIEW));
440 <                bcopy(vp, &ourview, sizeof(VIEW));
441 <                newimage();
438 >        } else if (memcmp((char *)vp, (char *)&ourview, sizeof(VIEW))) {
439 >                oldview = ourview;
440 >                ourview = *vp;
441 >                newimage(NULL);
442          }
443   }
444  
445  
446 < moveview(angle, mag, vc)                        /* move viewpoint */
447 < double  angle, mag;
448 < FVECT  vc;
446 > void
447 > moveview(                                       /* move viewpoint */
448 >        double  angle,
449 >        double  elev,
450 >        double  mag,
451 >        FVECT  vc
452 > )
453   {
267        extern double  sqrt(), dist2();
454          double  d;
455 <        FVECT  v;
456 <        VIEW  nv;
457 <        register int  i;
455 >        FVECT  v1;
456 >        VIEW  nv = ourview;
457 >        int  i;
458  
273        VCOPY(nv.vup, ourview.vup);
274        nv.hresolu = ourview.hresolu; nv.vresolu = ourview.vresolu;
459          spinvector(nv.vdir, ourview.vdir, ourview.vup, angle*(PI/180.));
460 <        if ((nv.type = ourview.type) == VT_PAR) {
461 <                nv.horiz = ourview.horiz / mag;
462 <                nv.vert = ourview.vert / mag;
460 >        if (elev != 0.0) {
461 >                fcross(v1, ourview.vup, nv.vdir);
462 >                normalize(v1);
463 >                spinvector(nv.vdir, nv.vdir, v1, elev*(PI/180.));
464 >        }
465 >        if (nv.type == VT_PAR) {
466 >                nv.horiz /= mag;
467 >                nv.vert /= mag;
468 >                d = 0.0;                        /* don't move closer */
469                  for (i = 0; i < 3; i++)
470 <                        v[i] = vc[i] - ourview.vp[i];
281 <                d = DOT(v, ourview.vdir);       /* don't move closer */
470 >                        d += (vc[i] - ourview.vp[i])*ourview.vdir[i];
471          } else {
283                nv.horiz = ourview.horiz;
284                nv.vert = ourview.vert;
472                  d = sqrt(dist2(ourview.vp, vc)) / mag;
473 +                if (nv.vfore > FTINY) {
474 +                        nv.vfore += d - d*mag;
475 +                        if (nv.vfore < 0.0) nv.vfore = 0.0;
476 +                }
477 +                if (nv.vaft > FTINY) {
478 +                        nv.vaft += d - d*mag;
479 +                        if (nv.vaft <= nv.vfore) nv.vaft = 0.0;
480 +                }
481 +                nv.vdist /= mag;
482          }
483          for (i = 0; i < 3; i++)
484                  nv.vp[i] = vc[i] - d*nv.vdir[i];
# Line 290 | Line 486 | FVECT  vc;
486   }
487  
488  
489 < spinvector(vres, vorig, vnorm, theta)   /* rotate vector around normal */
490 < FVECT  vres, vorig, vnorm;
491 < double  theta;
489 > void
490 > pcopy(                                  /* copy paint node p1 into p2 */
491 >        PNODE  *p1,
492 >        PNODE  *p2
493 > )
494   {
495 <        extern double  sin(), cos();
496 <        double  sint, cost, dotp;
497 <        FVECT  vperp;
498 <        register int  i;
499 <        
500 <        if (theta == 0.0) {
501 <                VCOPY(vres, vorig);
495 >        copycolor(p2->v, p1->v);
496 >        p2->x = p1->x;
497 >        p2->y = p1->y;
498 > }
499 >
500 >
501 > void
502 > zoomview(                               /* zoom in or out */
503 >        VIEW  *vp,
504 >        double  zf
505 > )
506 > {
507 >        switch (vp->type) {
508 >        case VT_PAR:                            /* parallel view */
509 >                vp->horiz /= zf;
510 >                vp->vert /= zf;
511                  return;
512 +        case VT_ANG:                            /* angular fisheye */
513 +                vp->horiz /= zf;
514 +                if (vp->horiz > 360.)
515 +                        vp->horiz = 360.;
516 +                vp->vert /= zf;
517 +                if (vp->vert > 360.)
518 +                        vp->vert = 360.;
519 +                return;
520 +        case VT_PLS:                            /* planisphere fisheye */
521 +                vp->horiz = sin((PI/180./2.)*vp->horiz) /
522 +                                (1.0 + cos((PI/180./2.)*vp->horiz)) / zf;
523 +                vp->horiz *= vp->horiz;
524 +                vp->horiz = (2.*180./PI)*acos((1. - vp->horiz) /
525 +                                                (1. + vp->horiz));
526 +                vp->vert = sin((PI/180./2.)*vp->vert) /
527 +                                (1.0 + cos((PI/180./2.)*vp->vert)) / zf;
528 +                vp->vert *= vp->vert;
529 +                vp->vert = (2.*180./PI)*acos((1. - vp->vert) /
530 +                                                (1. + vp->vert));
531 +                return;
532 +        case VT_CYL:                            /* cylindrical panorama */
533 +                vp->horiz /= zf;
534 +                if (vp->horiz > 360.)
535 +                        vp->horiz = 360.;
536 +                vp->vert = atan(tan(vp->vert*(PI/180./2.))/zf) / (PI/180./2.);
537 +                return;
538 +        case VT_PER:                            /* perspective view */
539 +                vp->horiz = atan(tan(vp->horiz*(PI/180./2.))/zf) /
540 +                                (PI/180./2.);
541 +                vp->vert = atan(tan(vp->vert*(PI/180./2.))/zf) /
542 +                                (PI/180./2.);
543 +                return;
544 +        case VT_HEM:                            /* hemispherical fisheye */
545 +                vp->horiz = sin(vp->horiz*(PI/180./2.))/zf;
546 +                if (vp->horiz >= 1.0-FTINY)
547 +                        vp->horiz = 180.;
548 +                else
549 +                        vp->horiz = asin(vp->horiz) / (PI/180./2.);
550 +                vp->vert = sin(vp->vert*(PI/180./2.))/zf;
551 +                if (vp->vert >= 1.0-FTINY)
552 +                        vp->vert = 180.;
553 +                else
554 +                        vp->vert = asin(vp->vert) / (PI/180./2.);
555 +                return;
556          }
306        sint = sin(theta);
307        cost = cos(theta);
308        dotp = DOT(vorig, vnorm);
309        fcross(vperp, vnorm, vorig);
310        for (i = 0; i < 3; i++)
311                vres[i] = vnorm[i]*dotp*(1.-cost) +
312                                vorig[i]*cost + vperp[i]*sint;
557   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines