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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1180 - (view) (download)

1 : glk 1168
2 :    
3 :     int outSize = 200;
4 :    
5 : jhr 1180 field#1(2)[] F = ctmr ⊛ load("../../data/ddro-115.nrrd");
6 : glk 1168
7 :     strand sample (int ui, int vi) {
8 :     real uu = lerp(0.0, 1.0, -0.5, real(ui), real(outSize)-0.5);
9 :     real vv = lerp(0.0, 1.0, -0.5, real(vi), real(outSize)-0.5);
10 :     vec2 pos = [uu, vv];
11 :     output vec3 out = [nan,nan,nan];
12 :    
13 :     update {
14 :     vec2 grad = ∇F(pos) if (inside(pos,F))
15 :     else [2000.0,0.0];
16 :     out = [grad[0], grad[1], |grad|];
17 :     stabilize;
18 :     }
19 :     }
20 :    
21 :     initially [ sample(ui, vi) | vi in 0..(outSize-1), ui in 0..(outSize-1) ];

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