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


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



© 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