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

SCM Repository

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

Diff of /branches/pure-cfg/test/mip-cam.diderot

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

revision 690, Fri Mar 25 00:23:10 2011 UTC revision 692, Fri Mar 25 04:51:02 2011 UTC
# Line 25  Line 25 
25  int imgResV = 240;  int imgResV = 240;
26  real rayStep = 1.0;  real rayStep = 1.0;
27    
 image(3)[] img = load (dataFile);  
 //field#2(3)[] F = img ⊛ bspln3;  
 field#0(3)[] F = img ⊛ tent;  
   
 strand RayCast (int ui, int vi)  
 {  
28      real camDist = |camAt - camEye|;      real camDist = |camAt - camEye|;
29      real camVspNear = camDist + camNear;      real camVspNear = camDist + camNear;
30      real camVspFar = camDist + camFar;      real camVspFar = camDist + camFar;
# Line 48  Line 42 
42      real camTmpR = camFOV*3.1415926536/360.0;      real camTmpR = camFOV*3.1415926536/360.0;
43      real camVmax = sin(camTmpR)/cos(camTmpR)*camDist;      real camVmax = sin(camTmpR)/cos(camTmpR)*camDist;
44      real camUmax = camVmax*real(imgResU)/real(imgResV);      real camUmax = camVmax*real(imgResU)/real(imgResV);
45    
46    image(3)[] img = load (dataFile);
47    //field#2(3)[] F = img ⊛ bspln3;
48    field#0(3)[] F = img ⊛ tent;
49    
50    strand RayCast (int ui, int vi)
51    {
52      // HEY (want) would like to say:      // HEY (want) would like to say:
53      // real rayU = lerp(-0.5, ui, imgResU-0.5, -camUmax, camUmax)      // real rayU = lerp(-0.5, ui, imgResU-0.5, -camUmax, camUmax)
54      // HEY (BUG) C syntax error with "real(ui) - -0.5" vs "real(ui) + 0.5";      // HEY (BUG) C syntax error with "real(ui) - -0.5" vs "real(ui) + 0.5";
55      // generated C code looks like "(float)p_ui_0--0.5e0f"      // generated C code looks like "(float)p_ui_0--0.5e0f"
56      real rayU = 2.0*camUmax*(real(ui) + 0.5)/real(imgResU) - camUmax;      real rayU = 2.0*camUmax*(real(ui) + 0.5)/real(imgResU) - camUmax;
57      real rayV = 2.0*camVmax*(real(vi) + 0.5)/real(imgResV) - camVmax;      real rayV = 2.0*camVmax*(real(vi) + 0.5)/real(imgResV) - camVmax;
58      vec3 rayDir = (camDist*camN + rayU*camU + rayV*camV)/camDist;      vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;
59    
60      real rayN = camVspNear;      real rayN = camVspNear;
61      // ########## BEGIN per-ray initialization      // ########## BEGIN per-ray initialization
# Line 63  Line 64 
64    
65      update      update
66      {      {
67          vec3 rayPos = camEye + rayN*rayDir;          vec3 rayPos = camEye + rayN*rayVec;
68          if (inside (rayPos,F)) {          if (inside (rayPos,F)) {
69           // ########## BEGIN per-sample code           // ########## BEGIN per-sample code
70            maxval = max(maxval, F@rayPos);            maxval = max(maxval, F@rayPos);

Legend:
Removed from v.690  
changed lines
  Added in v.692

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