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

SCM Repository

[diderot] View of /trunk/rtest/tests/convo3d0/convo3d0.diderot
ViewVC logotype

View of /trunk/rtest/tests/convo3d0/convo3d0.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3349 - (download) (annotate)
Tue Oct 27 15:16:36 2015 UTC (5 years, 10 months ago) by jhr
File size: 789 byte(s)
making copyrights consistent for all code in the repository
/*! \file convo3d0.diderot
 *
 * \author Gordon Kindlmann
 */

/*
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2015 The University of Chicago
 * All rights reserved.
 */

int outSize = 50;

field#0(3)[] F = tent ⊛ image("../../data/ring.nrrd");

strand sample (int ui, int vi, int wi) {
   real uu = lerp(-1.0, 1.0, -0.5, real(ui), real(outSize)-0.5);
   real vv = lerp(-1.0, 1.0, -0.5, real(vi), real(outSize)-0.5);
   real ww = lerp(-1.0, 1.0, -0.5, real(wi), real(outSize)-0.5);
   vec3 pos = [uu, vv, ww];
   output real val = -0.6; 

   update {
      val = F(pos) if (inside(pos,F)) else -0.6;
      stabilize;
   }
}

initially [ sample(ui, vi, wi) | wi in 0..(outSize-1), vi in 0..(outSize-1), ui in 0..(outSize-1) ];

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