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

Comparing ray/src/hd/sm_stree.c (file contents):
Revision 3.12 by gwlarson, Thu Jun 10 15:22:24 1999 UTC vs.
Revision 3.13 by greg, Sat Feb 22 02:07:25 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * sm_stree.c
6   *  An stree (spherical quadtree) is defined by an octahedron in
# Line 16 | Line 13 | static char SCCSid[] = "$SunId$ SGI";
13   #include "sm_list.h"
14   #include "sm_flag.h"
15   #include "sm_geom.h"
16 + #include "object.h"
17   #include "sm_qtree.h"
18   #include "sm_stree.h"
19  
# Line 450 | Line 448 | int n;
448      id1 = id2;
449    }
450   }
451 + /* Assumption: know crosses plane:dont need to check for 'on' case */
452 + intersect_edge_coord_plane(v0,v1,w,r)
453 + FVECT v0,v1;
454 + int w;
455 + FVECT r;
456 + {
457 +  FVECT dv;
458 +  int wnext;
459 +  double t;
460  
461 +  VSUB(dv,v1,v0);
462 +  t = -v0[w]/dv[w];
463 +  r[w] = 0.0;
464 +  wnext = (w+1)%3;
465 +  r[wnext] = v0[wnext] + dv[wnext]*t;
466 +  wnext = (w+2)%3;
467 +  r[wnext] = v0[wnext] + dv[wnext]*t;
468 + }
469 +
470 +
471   stVisit_clip(st,i,verts,vcnt,l,cell,func,n)
472       STREE *st;
473       int i;
# Line 619 | Line 636 | stVisit(st,tri,func,n)
636   }
637  
638  
622 /* New Insertion code!!! */
623
624
639   BCOORD qtRoot[3][3] = { {MAXBCOORD2,0,0},{0,MAXBCOORD2,0},{0,0,MAXBCOORD2}};
640  
641  
# Line 737 | Line 751 | stInsert_samp(st,p,f)
751      i = stLocate_root(p);
752      qt = ST_ROOT_QT(st,i);
753      
740     /* Will return lowest level triangle containing point: It the
741       point is on an edge or vertex: will return first associated
742       triangle encountered in the child traversal- the others can
743       be derived using triangle adjacency information
744    */
754      vert_to_qt_frame(i,p,bcoordi);
755      ST_ROOT_QT(st,i) =  qtInsert_point(i,qt,EMPTY,qtRoot[0],qtRoot[1],
756                            qtRoot[2],bcoordi,MAXBCOORD2>>1,f,0,&done);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines