Basic HTML version of Foils prepared March 18 1998

Foil 32 How can we write our own Interpolator? ECMAScript Example -II

From Scripting and EAI in VRML97 CPS616 -- Information Track of CPS -- Spring Semester 98. by Hasan Ozdemir (Geoffrey C. Fox)

VRML97 and Listing of Example of Script to produce a Position Interpolater for Foil 32
DEF Action1 Script {
eventIn SFFloat clicked
eventOut SFVec3f set_position
url "vrmlscript: // Note: Cosmo Player 2.0 still wants to see vrmlscript
function clicked(time)
{ set_position[0] = 1.0+time*1;
set_position[1] = Math.sin(time*6.28);
set_position[2] = 0.0;
}"
}
ROUTE GO.touchTime TO TIME1.startTime
ROUTE TIME1.fraction_changed TO Action1.clicked
ROUTE Action1.set_position TO T1.set_translation



© 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 Nov 29 1998