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

SCM Repository

[diderot] Annotation of /branches/fem/examples/d2s/simple_lerp/simple_lerp.diderot
ViewVC logotype

Annotation of /branches/fem/examples/d2s/simple_lerp/simple_lerp.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3356 - (view) (download)

1 : cchiw 3246 input int imgResU;
2 :     input int imgResV;
3 :     input int physicalxo=0;
4 :     input int physicalxn=1;
5 :     input int physicalyo=0;
6 :     input int physicalyn=1;
7 :     input fem#0(2)[] m ;
8 :     field#0(2)[] F=toField(m) ;
9 :    
10 :     strand sample (int ui, int vi) {
11 : cchiw 3356 real uu = lerp(physicalxo, physicalxn, -0.5, real(ui), real(imgResU)-0.5);
12 :     real vv = lerp(physicalyo, physicalyn, -0.5, real(vi), real(imgResV)-0.5);
13 :    
14 :     //real uu = lerp(physicalxo, physicalxn, 0, real(ui), real(imgResU-1));
15 :     //real vv = lerp(physicalyo, physicalyn, 0, real(vi), real(imgResV-1));
16 :    
17 : cchiw 3246 vec2 pos = [uu, vv];
18 :     output real out = -0.6;
19 :    
20 :     update {
21 : cchiw 3356 out = F(pos) if (inside(pos,F)) else -0.6;
22 :     //out=99;
23 : cchiw 3246 stabilize;
24 :     }
25 :     }
26 :    
27 :     initially [ sample(ui, vi) | vi in 0..(imgResV-1), ui in 0..(imgResU-1) ];

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