SCM Repository
[diderot] / branches / pure-cfg / test / zslice2.diderot |
View of /branches/pure-cfg/test/zslice2.diderot
Parent Directory
|
Revision Log
Revision 770 -
(download)
(annotate)
Thu Apr 7 20:42:13 2011 UTC (10 years ago) by glk
File size: 1117 byte(s)
Thu Apr 7 20:42:13 2011 UTC (10 years ago) by glk
File size: 1117 byte(s)
used lerp where possible, other cosmetic changes
// zslice2 int dataSize = 11; int imgSize = 200; vec3 orig = [0.0, 0.0, 5.0]; vec3 cVec = [0.0, 1.0, 0.0]; vec3 rVec = [1.0, 0.0, 0.0]; // HEY (bug), next line causes: // uncaught exception Fail [Fail: Error in compiling zslice2.diderot] // raised at driver/main.sml:31.39-31.76 // but is this not valid syntax for creating field in one shot? //field#2(3)[] F = (load("../data/zimg112.nrrd")) ⊛ bspln3; // It is valid syntax, but there is a bug in the conversion from HighIL to MidIL image(3)[] img = load("../data/zimg112.nrrd"); //field#2(3)[] F = img ⊛ bspln3; //field#2(3)[] F = img ⊛ ctmr; //field#0(3)[] F = img ⊛ tent; field#1(3)[] F = img ⊛ c1tent; strand RayCast (int row, int col) { real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5); real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5); vec3 pos = orig + rr*rVec + cc*cVec; output real val = -∞; update { if (inside (pos,F)) { val = F@pos; } stabilize; } } initially [ RayCast(r, c) | r in 0..(imgSize-1), c in 0..(imgSize-1) ];
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |