Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/test/vr-MIP.diderot
ViewVC logotype

Diff of /trunk/test/vr-MIP.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 142, Thu Jul 8 19:12:02 2010 UTC revision 206, Tue Aug 3 16:55:43 2010 UTC
# Line 4  Line 4 
4  //  //
5    
6  input string dataFile;          // name of dataset  input string dataFile;          // name of dataset
7  input real stepSz;              // size of steps  input real stepSz = 0.1;        // size of steps
8                                    // e.g. 0.1
9  input vec3 eye;                 // location of eye point  input vec3 eye;                 // location of eye point
10                                    // e.g. (25,15,10)
11  input vec3 orig;                // location of pixel (0,0)  input vec3 orig;                // location of pixel (0,0)
12                                    // e.g. txs: (8.83877,2.5911,7.65275)
13                                    // e.g. vox1: (7.45013,2.9202,5.53883)
14  input vec3 cVec;                // vector between pixels horizontally  input vec3 cVec;                // vector between pixels horizontally
15                                    // e.g. txs: (-0.0151831,0.0278357,0)
16                                    // e.g. vox1: (-0.00930055,0.0164548,0)
17  input vec3 rVec;                // vector between pixels vertically  input vec3 rVec;                // vector between pixels vertically
18                                    // e.g. txs: (0.0074887,0.00408474,-0.0305383)
19                                    // e.g. vox1: (0.00476876,0.00269539,-0.0180902)
20    
21  image(3)[] img = load (dataFile);  image(3)[] img = load (dataFile);
22    
# Line 20  Line 28 
28      vec3        pos = orig + real(row)*rVec + real(col)*cVec;      vec3        pos = orig + real(row)*rVec + real(col)*cVec;
29      vec3        dir = (pos - eye)/|pos - eye|;      vec3        dir = (pos - eye)/|pos - eye|;
30      real        t = 0.0;      real        t = 0.0;
31      real        maxval = -inf;      output real maxval = -inf;
     int         num = 0;  
32    
33      update      update
34      {      {
35          vec3 pt = pos + t*dir;          pos = pos + stepSz*dir;
36          real val = F@pt;          if (inside (pos,F)) {
37              real val = F@pos;
38          maxval = max(val, maxval);          maxval = max(val, maxval);
39          if (t > 1.0)          }
40            if (t > 20.0)
41              stabilize;              stabilize;
42          t = t + stepSz;          t = t + stepSz;
         num = num + 1;  
43      }      }
44    
45      /* render: output maxval */      /* render: output maxval */
46  }  }
47    
48  initially [ RayCast(r, c) | r in 0..1023, c in 0..1023 ];  initially [ RayCast(r, c) | r in 0..199, c in 0..199 ];

Legend:
Removed from v.142  
changed lines
  Added in v.206

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0