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

SCM Repository

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

View of /branches/pure-cfg/test/norm2.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 947 - (download) (annotate)
Fri Apr 22 14:54:00 2011 UTC (8 years, 6 months ago) by jhr
File size: 583 byte(s)
  Fixed issue with normalize on 2D vectors

int imgSizeX = 300;
int imgSizeY = 200;

image(2)[2] Vimg = load("../data/vorttest.nrrd");
field#1(2)[2] V = Vimg ⊛ ctmr;
image(2)[] Rimg = load("../data/vorttest-rand.nrrd");
field#0(2)[] R = Rimg ⊛ tent;

strand LIC (int xi, int yi) {
    real xx = lerp(0.0, 3.0, -0.5, real(xi), real(imgSizeX)-0.5);
    real yy = lerp(0.0, 2.0, -0.5, real(yi), real(imgSizeY)-0.5);
    vec2 pos = [xx,yy];
    output vec2 blah = [0.0,0.0];

    update {
        blah = normalize(V(pos));
        stabilize;
    }
}

initially [ LIC(xi, yi) | yi in 0..(imgSizeY-1), xi in 0..(imgSizeX-1) ];

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