DEF Example_2 Script { |
eventIn SFTime touched1 |
eventOut SFVec3f new_translation |
field MFVec3f verts [] |
field SFInt32 count 1 |
url "javascript: |
function initialize( ) { |
verts[0] = new SFVec3f(0, 0, 0); |
verts[1] = new SFVec3f(1, 1.732, 0); |
verts[2] = new SFVec3f(2, 0, 0); |
verts[3] = new SFVec3f(1, 0.577, 1.732); |
} |
function touched1 (value) { |
new_translation = verts[count]; // move sphere around tetra |
count++; |
if (count >= verts.length) count = 1; |
}" } |