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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3349 - (view) (download)

1 : jhr 2636 /*! \file convo3d0.diderot
2 :     *
3 :     * \author Gordon Kindlmann
4 :     */
5 : glk 1188
6 : jhr 2636 /*
7 : jhr 3349 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
8 :     *
9 :     * COPYRIGHT (c) 2015 The University of Chicago
10 : jhr 2636 * All rights reserved.
11 :     */
12 : glk 1188
13 :     int outSize = 50;
14 :    
15 : jhr 2636 field#0(3)[] F = tent ⊛ image("../../data/ring.nrrd");
16 : glk 1188
17 :     strand sample (int ui, int vi, int wi) {
18 :     real uu = lerp(-1.0, 1.0, -0.5, real(ui), real(outSize)-0.5);
19 :     real vv = lerp(-1.0, 1.0, -0.5, real(vi), real(outSize)-0.5);
20 :     real ww = lerp(-1.0, 1.0, -0.5, real(wi), real(outSize)-0.5);
21 :     vec3 pos = [uu, vv, ww];
22 :     output real val = -0.6;
23 :    
24 :     update {
25 :     val = F(pos) if (inside(pos,F)) else -0.6;
26 :     stabilize;
27 :     }
28 :     }
29 :    
30 :     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