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
1 DEF Action1 Script {
2 eventIn SFFloat clicked
3 eventOut SFVec3f set_position
4 url "vrmlscript: // Note: Cosmo Player 2.0 still wants to see vrmlscript
5 function clicked(time)
6 { set_position[0] = 1.0+time*1;
7 set_position[1] = Math.sin(time*6.28);
8 set_position[2] = 0.0;
9 }"
10 }
11 ROUTE GO.touchTime TO TIME1.startTime
12 ROUTE TIME1.fraction_changed TO Action1.clicked
13 ROUTE Action1.set_position TO T1.set_translation

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