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

SCM Repository

[diderot] View of /branches/vis15/src/tests/rtest/tests/cmap/cmap.diderot
ViewVC logotype

View of /branches/vis15/src/tests/rtest/tests/cmap/cmap.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4497 - (download) (annotate)
Sat Sep 3 14:12:36 2016 UTC (2 years, 8 months ago) by jhr
File size: 697 byte(s)
  working on merge: updating tests with new version 2 syntax
/* cmap.diderot
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2016 The University of Chicago
 * All rights reserved.
 *
 * Test the probing of a 1D vector field (i.e., color map).
 */

field#0(1)[3] cmap = image("../../data/isobow-cmap.nrrd") ⊛ tent;

strand CMap (vec2 pos) {
    output vec3 out = [0,0,0];

    update {
	real x = 0.5 * (pos[0] + pos[1]);
//	if (inside (x, cmap)) {
	    out = cmap(x);
//	}
	stabilize;
    }
}

//create_array { CMap([lerp(0, 1, 1, xi, 200), lerp(0, 1, 1, yi, 200)]) | xi in 1..200, yi in 1..200 }
initially [ CMap([lerp(0, 1, 1, xi, 200), lerp(0, 1, 1, yi, 200)]) | xi in 1..200, yi in 1..200 ];

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