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

SCM Repository

[diderot] Diff of /branches/tash/test/vr.diderot
ViewVC logotype

Diff of /branches/tash/test/vr.diderot

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

trunk/test/vr.diderot revision 38, Thu Feb 11 03:51:54 2010 UTC branches/fem/test/vr.diderot revision 3210, Mon Jul 13 14:39:06 2015 UTC
# Line 3  Line 3 
3  // volume rendering example in Diderot  // volume rendering example in Diderot
4  //  //
5    
 input string dataFile;          // name of dataset  
6  input real stepSz;              // size of steps  input real stepSz;              // size of steps
7    input vec<3> light;
8    input int wid = 640;
9    input int ht = 480;
10    
11  image<3> img = load (dataFile);  input image[3] img;
12    
13  actor RayCast (int row, int col)  field#1[3] F = convolve (bspln3, img);
14    
15    strand RayCast (int row, int col)
16  {  {
17      vec<3>      dir = (real(row), real(col));      vec<3>      dir = (real(row), real(col), 0.0);
18      vec<3>      pos = (0.0, 0.0);      vec<3>      pos = (0.0, 0.0, 0.0);
19      vec<3>      t = 0.0;      real        t = 0.0;
20        real[4]     color = (0.0, 0.0, 0.0, 0.0);
21    
22      update      update
23      {      {
24          pos = pos + t*dir;          vec<3> pt = pos + t*dir;
25            t = t + stepSz;
26            vec<3> g = (D F)@pt;
27            color = over(color, phong(light, g, txf(F@pt)));
28            if (color[3] >= 0.999)
29                stabilize;
30      }      }
31    
32  }  }
33    
34    initially
35      [ RayCast(r, c) | r in 0 .. ht-1, c in 0 .. wid-1 ];

Legend:
Removed from v.38  
changed lines
  Added in v.3210

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