// lic-turb.diderot // // demo of line integral convolution (LIC) on 2D turbulent flow // // process output with: // unu reshape -i lic-turb2d.txt -s 3 1020 561 | unu quantize -b 8 -o lic-turb2d.ppm int imgSizeX = 500; int imgSizeY = 500; real h = 0.005; // step size of integration int stepNum = 10; // take this many steps both upstream and downstream // field#2(2)[2] V = load("imp-u.nrrd") ⊛ bspln3; field#1(2)[2] V = load("imp-u.nrrd") ⊛ ctmr; field#0(2)[] R = load("../../data/R.nrrd") ⊛ tent; strand LIC (int xi, int yi) { real xx = lerp(0.0, 8.0, 0.0, real(xi), real(imgSizeX)-1.0); real yy = lerp(0.0, 8.0, 0.0, real(yi), real(imgSizeY)-1.0); vec2 pos0 = [xx,yy]; output vec3 RGB = [0.0, 0.0, 0.0]; update { tensor[2,2] J = ∇⊗V(pos0); RGB = [J[0,0], J[0,1], J[0,0]]; stabilize; } } initially [ LIC(xi, yi) | yi in 0..(imgSizeY-1), xi in 0..(imgSizeX-1) ];
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: stabilize; } } initially [ LIC(xi, yi) | yi in 0..(imgSizeY-1), xi in 0..(imgSizeX-1) ];