
adding information with EAI
On Thu, 28 May 1998 08:53:21 -0700, maryse DA PONTE
Quote:
>thanks for the answers of bram and bob, two days ago.
>I would like to know if the EAI can be used for my problem : link
>additional information to a vrml object ? if I have an object, engine
>for example, and i want to associate specific information to this node
>like its designation, its manufacturer... can i use the EAI ? If it is
>possible, how ?
>I had somme answers which gave me help but, these answers concerned the
>display of its information. I am interesting by how link this
>information to a vrml node anf if EAI can help me and use.
Hi,
it is certainly possible with the EAI. I assume that you are familiar
with Java programming. Here is a code snippet that describes what you
need to do:
1. do all the EAI stuff; one of my tutorials (www.vruniverse.com)
gives you an introduction to EAI programming and you can find also
lots of info at the SGI website (www.cosmoworlds.com)
2. get your nodes:
Node first = browser.getNode("first");
Node second = browser.getNode("second");
3. create an object that holds all the information for your
nodes:
class NodeInfo {
Node myNode;
String info1; etc.
NodeInfo(Node myNode, String info1, String info2,...) {
myNode = myNode;
info1 = info1;
etc.
}
accessor methods etc.
}
4. instantiate your NodeInfos and store them in a vector:
Vector allMyNodes = new Vector();
allMyNodes.addElement(new NodeInfo(first,
"manufacturere"...))
There are lots of other ways to do this. If you need complete control
of your VRML world then EAI is the way to go.
Markus
_________________________________________________________________
Markus Roskothen
Information Architect at www.infoplasm.com and www.vruniverse.com
USA 510-864-9539