Basic HTML version of Foils prepared 5 August 97

Foil 9 EventIn Handling - initialize() - II

From VRML97 Scripting: JavaScript Nodes UC Web Applications Certificate -- July 24 1997. by Wojtek Furmanski and Hasan Ozdemir


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 }" }

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Apr 5 1998