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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1079 - (download) (annotate)
Wed May 4 07:26:39 2011 UTC (8 years, 7 months ago) by glk
File size: 1457 byte(s)
is this not the way to do an if else?

field#2(3)[] F = bspln3 ⊛ load("../data/vfrhand-nohip.nhdr");

// set camera, image, and rendering parameters
vec3 camEye = [-642.237,-865.789,886.094];
vec3 camAt = [85.6383,77.2715,88.2113];
vec3 camUp = [0.852904,-0.474991,0.216652];
real camNear = -80.0;
real camFar = -72.0;
real camFOV = 3.34;

int imgResU = 320;
int imgResV = 240;
real rayStep = 0.1;
real valOpacMin = 510.0;        // 400.0 for skin, 1150.0 for bone
real valOpacMax = 550.0;        // 700.0 for skin, 1450.0 for bone

// (boilerplate) computation of camera and light info
real camDist = |camAt - camEye|;
real camVspNear = camNear + camDist;
real camVspFar = camFar + camDist;
vec3 camN = normalize(camAt - camEye);
vec3 camU = normalize(camN × camUp);
vec3 camV = camN × camU;
real camVmax = tan(camFOV*3.1415926536/360.0)*camDist;
real camUmax = camVmax*real(imgResU)/real(imgResV);

strand RayCast (int vali) {
    real rayU = lerp(-camUmax, camUmax, -0.5, real(196), real(imgResU)-0.5);
    real rayV = lerp(-camVmax, camVmax, -0.5, real(92), real(imgResV)-0.5);
    vec3 rayVec = (camDist*camN + rayU*camU + rayV*camV)/camDist;

    output vec3 out = [0.0, 0.0, 0.0];

    update {
       vec3 pos = camEye + camVspNear*rayVec;
       vec3 grad = -∇F(pos); 

       if (0 == vali) {
         out = pos;
       } else if (1 == vali) {
         out = grad;
       }
       stabilize;
    }

    /* render: output maxval */
}

initially [ RayCast(vali) | vali in 0..3 ];

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