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

SCM Repository

[diderot] View of /branches/vis12/test/paths-BUG.diderot
ViewVC logotype

View of /branches/vis12/test/paths-BUG.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1905 - (download) (annotate)
Sun Jun 3 05:43:43 2012 UTC (7 years, 2 months ago) by glk
File size: 888 byte(s)
paths not quite working
int reso = 3;

strand trace(int aa, int bb) {
    int steps = 0;
    vec2 posInit = [lerp(-1.0, 1.0, 1.0, real(aa), real(reso)),
                    lerp(-1.0, 1.0, 1.0, real(bb), real(reso))];
    vec2 pos = posInit;
    int stepsMax = 1 + aa + reso*bb;
    output vec2{} path = {pos};

    update {
        if (0 == steps) {
           /* HEY it would make a lot of sense to allow print() 
              amongst the strand initialization statements */
           print("trace(", aa, ",", bb, ")=>stepsMax=", stepsMax, ", posInit=", posInit, "\n");
        }
        print("   (", aa, ",", bb, "): steps=", steps, ",pos=", pos, ")\n");
        pos *= 1.01;
        path = path@pos;
        // BUG: path does not seem to be updated
        steps += 1;
        if (steps == stepsMax) {
            stabilize;
        }
    }
}

initially { trace(aa, bb) | bb in 1..reso, aa in 1..reso };

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