Basic HTML version of Foils prepared March 18 1998

Foil 20 Getting Handle of Another Node in Script Node with Java

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


DEF SomeNode Transform {} # A transform node (flush out!)
Script { # A Script node
field SFNode node USE SomeNode # SomeNode is a Transform node
eventIn SFVec3f pos # new value to be inserted in
# SomeNode's translation field
url "Example3.class"
}
# while Example3.class is:
public class ExampleGetAnotherNode extends Script {
private SFNode node; // field
public void initialize()
{ node = (SFNode) getField("node"); }
}
It is possible to access any field of the node object.



© 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