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

SCM Repository

[diderot] Diff of /branches/pure-cfg/test/vr-lite-cam.diderot
ViewVC logotype

Diff of /branches/pure-cfg/test/vr-lite-cam.diderot

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

revision 693, Fri Mar 25 04:54:52 2011 UTC revision 704, Tue Mar 29 17:46:40 2011 UTC
# Line 21  Line 21 
21    
22  string dataFile = "../data/vfrhand-nohip.nhdr";  string dataFile = "../data/vfrhand-nohip.nhdr";
23  vec3 camEye = [127.331, -1322.05, 272.53];  vec3 camEye = [127.331, -1322.05, 272.53];
24  vec3 camAt = [63.0, 82.6536, 101.999];  vec3 camAt = [63.0, 82.6536, 98.0];
25  vec3 camUp = [0.9987, 0.0459166, -0.0221267];  vec3 camUp = [0.9987, 0.0459166, -0.0221267];
26  real camNear = -78.0;  real camNear = -78.0;
27  real camFar = 78.0;  real camFar = 78.0;
# Line 47  Line 47 
47  vec3 tmp0 = cross(camN,camUp);  vec3 tmp0 = cross(camN,camUp);
48  vec3 camU = tmp0/|tmp0|;  vec3 camU = tmp0/|tmp0|;
49  vec3 camV = cross(camN,camU);  vec3 camV = cross(camN,camU);
50  real tmp1 = camFOV*3.1415926536/360.0;  real camVmax = tan(camFOV*3.1415926536/360.0)*camDist;
 real camVmax = sin(tmp1)/cos(tmp1)*camDist;  
51  real camUmax = camVmax*real(imgResU)/real(imgResV);  real camUmax = camVmax*real(imgResU)/real(imgResV);
52    
53  vec3 lightVspDir = [0.9, -1.0, -2.5];  vec3 lightVspDir = [0.9, -1.0, -2.5];
# Line 56  Line 55 
55  // would make this transform to world-space less awkward; would be  // would make this transform to world-space less awkward; would be
56  // lightVspDir[0]*camU + lightVspDir[1]*camV + lightVspDir[2]*camN  // lightVspDir[0]*camU + lightVspDir[1]*camV + lightVspDir[2]*camN
57  // OR, we could create and apply a view-to-world matrix transform  // OR, we could create and apply a view-to-world matrix transform
58    //vec3 tmp2 = lightVspDir[0]*camU + lightVspDir[1]*camV + lightVspDir[2]*camN;
59  vec3 tmp2 = (  dot(lightVspDir,[1.0,0.0,0.0])*camU  vec3 tmp2 = (  dot(lightVspDir,[1.0,0.0,0.0])*camU
60               + dot(lightVspDir,[0.0,1.0,0.0])*camV               + dot(lightVspDir,[0.0,1.0,0.0])*camV
61               + dot(lightVspDir,[0.0,0.0,1.0])*camN);               + dot(lightVspDir,[0.0,0.0,1.0])*camN);
# Line 67  Line 67 
67  real phongSp = 30.0;  real phongSp = 30.0;
68    
69  image(3)[] img = load (dataFile);  image(3)[] img = load (dataFile);
70    //field#4(3)[] F = img ⊛ bspln5;
71  //field#2(3)[] F = img ⊛ bspln3;  //field#2(3)[] F = img ⊛ bspln3;
72  field#2(3)[] F = img ⊛ bspln3;  field#1(3)[] F = img ⊛ ctmr;
 // HEY (BUG): ctmr Catmull-Rom is C1 but not C2 continuous  
 //field#2(3)[] F = img ⊛ ctmr;  
73  //field#0(3)[] F = img ⊛ tent;  //field#0(3)[] F = img ⊛ tent;
74    
75  strand RayCast (int ui, int vi)  strand RayCast (int ui, int vi)
# Line 94  Line 93 
93            // ########## BEGIN per-sample code            // ########## BEGIN per-sample code
94            real val = F@rayPos;            real val = F@rayPos;
95            vec3 grad = ∇F@rayPos;            vec3 grad = ∇F@rayPos;
96            vec3 norm = -grad/|grad|;            vec3 norm = -∇F@rayPos/|∇F@rayPos|;
           // HEY (BUG) will get an "uncaught exception" if code is instead  
           // vec3 norm = -∇F@rayPos/|∇F@rayPos|;  
97            if (val > valOpacMin) {  // we have some opacity            if (val > valOpacMin) {  // we have some opacity
98                real opac =                real opac =
99                   1.0 if (val > valOpacMax)                   1.0 if (val > valOpacMax)

Legend:
Removed from v.693  
changed lines
  Added in v.704

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