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

SCM Repository

[diderot] Annotation of /branches/vis15/src/tests/rtest/tests/convo3d0/convo3d0.diderot
ViewVC logotype

Annotation of /branches/vis15/src/tests/rtest/tests/convo3d0/convo3d0.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4497 - (view) (download)

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