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

SCM Repository

[diderot] Annotation of /branches/pure-cfg/test/bug-usevar.diderot
ViewVC logotype

Annotation of /branches/pure-cfg/test/bug-usevar.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1079 - (view) (download)

1 : glk 1079
2 :    
3 :     field#2(3)[] F = bspln3 ⊛ load("../data/vfrhand-nohip.nhdr");
4 :    
5 :     // set camera, image, and rendering parameters
6 :     vec3 camEye = [-642.237,-865.789,886.094];
7 :     vec3 camAt = [85.6383,77.2715,88.2113];
8 :     vec3 camUp = [0.852904,-0.474991,0.216652];
9 :     real camNear = -80.0;
10 :     real camFar = -72.0;
11 :     real camFOV = 3.34;
12 :    
13 :     int imgResU = 320;
14 :     int imgResV = 240;
15 :     real rayStep = 0.1;
16 :     real valOpacMin = 510.0; // 400.0 for skin, 1150.0 for bone
17 :     real valOpacMax = 550.0; // 700.0 for skin, 1450.0 for bone
18 :    
19 :     // (boilerplate) computation of camera and light info
20 :     real camDist = |camAt - camEye|;
21 :     real camVspNear = camNear + camDist;
22 :     real camVspFar = camFar + camDist;
23 :     vec3 camN = normalize(camAt - camEye);
24 :     vec3 camU = normalize(camN × camUp);
25 :     vec3 camV = camN × camU;
26 :     real camVmax = tan(camFOV*3.1415926536/360.0)*camDist;
27 :     real camUmax = camVmax*real(imgResU)/real(imgResV);
28 :    
29 :     strand RayCast (int vali) {
30 :     real rayU = lerp(-camUmax, camUmax, -0.5, real(196), real(imgResU)-0.5);
31 :     real rayV = lerp(-camVmax, camVmax, -0.5, real(92), real(imgResV)-0.5);
32 :     vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;
33 :    
34 :     output vec3 out = [0.0, 0.0, 0.0];
35 :    
36 :     update {
37 :     vec3 pos = camEye + camVspNear*rayVec;
38 :     vec3 grad = -∇F(pos);
39 :    
40 :     if (0 == vali) {
41 :     out = pos;
42 :     } else if (1 == vali) {
43 :     out = grad;
44 :     }
45 :     stabilize;
46 :     }
47 :    
48 :     /* render: output maxval */
49 :     }
50 :    
51 :     initially [ RayCast(vali) | vali in 0..3 ];

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