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

SCM Repository

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

Diff of /branches/vis12/test/vr-curv-quad.diderot

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

revision 1383, Thu Jun 23 20:24:04 2011 UTC revision 1640, Wed Nov 16 02:19:51 2011 UTC
# Line 3  Line 3 
3  // Demonstration of curvature-based transfer functions in volume rendering  // Demonstration of curvature-based transfer functions in volume rendering
4  //  //
5  // process output with:  // process output with:
6  // unu reshape -i mip.txt -s 4 480 345 | overrgb -i - -b 0.1 0.15 0.2 -g 1.2 -o - | unu quantize -b 8 -min 0 -max 255  -o vr-curv-quad.png  // unu reshape -i vr-curv-quad.txt -s 4 480 345 | overrgb -i - -b 0.1 0.15 0.2 -g 1.2 -o - | unu quantize -b 8 -min 0 -max 255  -o vr-curv-quad.png
7    
8  // volume dataset  // volume dataset
9  field#2(3)[] F = bspln3 ⊛ load("../data/quad-patches-pad.nrrd");  field#2(3)[] F = bspln3 ⊛ load("../data/quad-patches-pad.nrrd");
# Line 63  Line 63 
63                vec3 grad = -∇F(pos);                vec3 grad = -∇F(pos);
64                vec3 norm = normalize(grad);                vec3 norm = normalize(grad);
65                // begin curvature computation                // begin curvature computation
66                tensor[3,3] H = ∇(∇F)(pos);                tensor[3,3] H = ∇⊗∇F(pos);
67                tensor[3,3] P = identity[3] - norm⊗norm;                tensor[3,3] P = identity[3] - norm⊗norm;
68                tensor[3,3] G = -(P•H•P)/|grad|;                tensor[3,3] G = -(P•H•P)/|grad|;
69                real disc = max(0.0, sqrt(2.0*|G|^2 - trace(G)^2));                real disc = max(0.0, sqrt(2.0*|G|^2 - trace(G)^2));
# Line 87  Line 87 
87         }         }
88         if (rayTransp < 0.01) {  // early ray termination         if (rayTransp < 0.01) {  // early ray termination
89            rayTransp = 0.0;            rayTransp = 0.0;
           outRGBA = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0 - rayTransp];  
90            stabilize;            stabilize;
91         }         }
92         if (rayN > camVspFar) {         if (rayN > camVspFar) {
           outRGBA = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0 - rayTransp];  
93            stabilize;            stabilize;
94         }         }
95         rayN = rayN + rayStep;         rayN = rayN + rayStep;
96      }      }
97    
98  //    stabilize {      stabilize {
99  //       outRGBA = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0 - rayTransp];         outRGBA = [rayRGB[0], rayRGB[1], rayRGB[2], 1.0 - rayTransp];
100  //    }      }
101    
102        /* render: output maxval */
103  }  }
104    
105  initially [ RayCast(ui, vi) | vi in 0..(imgResV-1), ui in 0..(imgResU-1) ];  initially [ RayCast(ui, vi) | vi in 0..(imgResV-1), ui in 0..(imgResU-1) ];

Legend:
Removed from v.1383  
changed lines
  Added in v.1640

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