Basic HTML version of Foils prepared March 18 1998

Foil 25 Producing Event with EAI

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

VRML97 Example for EAI(This example allows user to play with several parameters of a Cylinder object. It shows how Java can get the handle of a browser object, handle of a node in the world, handle of a eventIn(addChildren)/ eventOut(removeChildren), and add another node to world through EAI.)
1 First you get the handle of the eventIn field and then whenever you update its value, you will produce event for this sink.
2
3 EventInSFVec3f set_translation;
4
5 transform = browser.getNode("aNode");
6 set_translation = (EventInSFVec3f) transform.getEventIn("translation");
7 float [] val = new float[3];
8 val[0] = val[1]= val[2]=10.0;
9 set_translation.setValue(val);
10 DEF aNode in VRML File
11 Field in transform node

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