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

SCM Repository

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

Diff of /branches/pure-cfg/test/vr-curv-quad.diderot

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

revision 913, Thu Apr 21 18:54:26 2011 UTC revision 1062, Tue May 3 17:52:11 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.png  // 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
7    
8  image(3)[] img = load("../data/quad-patches-pad.nrrd");  field#2(3)[] F = load("../data/quad-patches-pad.nrrd") ⊛ bspln3;
9  field#2(3)[] F = img ⊛ bspln3;  field#0(2)[3] RGB = load("../data/txf/2d-bow.nrrd") ⊛ tent;
 image(2)[3] imgRGB = load("../data/hue.nhdr");  
 field#0(2)[3] RGB = imgRGB ⊛ tent;  
10    
11  // set camera, image, and rendering parameters  // set camera, image, and rendering parameters
12  vec3 camEye = [183.021, -411.857, 686.458];  vec3 camEye = [183.021, -411.857, 686.458];
# Line 56  Line 54 
54         vec3 pos = camEye + rayN*rayVec;         vec3 pos = camEye + rayN*rayVec;
55         if (inside (pos,F)) {         if (inside (pos,F)) {
56            real val = F(pos);            real val = F(pos);
57              if (val > valOpacMin) {  // we have some opacity
58            vec3 grad = -∇F(pos);            vec3 grad = -∇F(pos);
59            vec3 norm = normalize(grad);            vec3 norm = normalize(grad);
           if (val > valOpacMin) {  // we have some opacity  
60                // begin curvature computation                // begin curvature computation
61                tensor[3,3] H = -∇(∇F)(pos);                tensor[3,3] H = -∇(∇F)(pos);
62                tensor[3,3] P = identity[3] - norm⊗norm;                tensor[3,3] P = identity[3] - norm⊗norm;

Legend:
Removed from v.913  
changed lines
  Added in v.1062

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