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

SCM Repository

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

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

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

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

Legend:
Removed from v.36  
changed lines
  Added in v.1685

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