1 | DEF Example_2 Script { |
2 | eventIn SFTime touched1 |
3 | eventOut SFVec3f new_translation |
4 | field MFVec3f verts [] |
5 | field SFInt32 count 1 |
6 | url "javascript: |
7 | function initialize( ) { |
8 | verts[0] = new SFVec3f(0, 0, 0); |
9 | verts[1] = new SFVec3f(1, 1.732, 0); |
10 | verts[2] = new SFVec3f(2, 0, 0); |
11 | verts[3] = new SFVec3f(1, 0.577, 1.732); |
12 | } |
13 | function touched1 (value) { |
14 | new_translation = verts[count]; // move sphere around tetra |
15 | count++; |
16 | if (count >= verts.length) count = 1; |
17 | }" } |