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

SCM Repository

[diderot] Diff of /trunk/doc/report/vr-lite.tex
ViewVC logotype

Diff of /trunk/doc/report/vr-lite.tex

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

revision 370, Sat Oct 2 17:19:14 2010 UTC revision 371, Sat Oct 2 17:20:27 2010 UTC
# Line 5  Line 5 
5  input vec3 orig;                // location of pixel (0,0)  input vec3 orig;                // location of pixel (0,0)
6  input vec3 cVec;                // vector between pixels horizontally  input vec3 cVec;                // vector between pixels horizontally
7  input vec3 rVec;                // vector between pixels vertically  input vec3 rVec;                // vector between pixels vertically
8  input real valOpacMin;          // highest value with opacity 0.0  input real opacMin;             // highest value with opacity 0.0
9  input real valOpacMax;          // lowest value with opacity 1.0  input real opacMax;             // lowest value with opacity 1.0
10    
11  image(3)[] img = load (dataFile);  image(3)[] img = load (dataFile);
12  field#1(3)[] F = convolve (bspln3, img);  field#1(3)[] F = img $\circledast$ bspln3;
13    
14  actor RayCast (int row, int col)  actor RayCast (int row, int col)
15  {  {
# Line 26  Line 26 
26              real val = F@pos;              real val = F@pos;
27              vec3 grad = ($\nabla$ F)@pos;              vec3 grad = ($\nabla$ F)@pos;
28              vec3 norm = -grad/|grad|;              vec3 norm = -grad/|grad|;
29              if (val > valOpacMin) {  // we have some opacity              if (val > opacMin) {  // we have some opacity
30                  real opac = 0.0;     // dummy initialization                  real opac = 1.0 if (val > opacMax)
31                  if (val > valOpacMax) opac = 1.0;                              else (val - opacMin)/(opacMax - opacMin);
32                  else opac = (val - valOpacMin)/(valOpacMax - valOpacMin);                  gray = gray + transp*opac*max(0.0, -dir $\cdot$ norm);
                 gray = gray + transp*opac*max(0.0, dot(-dir,norm));  
33                  transp = transp*(1.0 - opac);                  transp = transp*(1.0 - opac);
34              }              }
35          }          }
# Line 38  Line 37 
37              transp = 0.0;              transp = 0.0;
38              stabilize;              stabilize;
39          }          }
40          else if (t > 40.0) {          else if (t > 40.0)
41              stabilize;              stabilize;
         }  
42          t = t + stepSz;          t = t + stepSz;
43      }      }
44    

Legend:
Removed from v.370  
changed lines
  Added in v.371

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