Kevin Kim wrote:
BTW, as a suggestion, these posts explicitly about Xj3D should really be
posted to the Web3D Consortiums Source code list rather than here, as
this list is really about Java3D programming at the low level.
> My question is that which class invokes that Script extended java
> class? DIYBrowser class invokes the my script class? or something else?
Ah, this is a question more about application architecture more than
what Xj3D can do. If your application wants to directly access parts of
the scene graph, you may be better off using the EAI (vrml.eai)
interfaces that are part of the VRML97 specification. This would give
you the direct ability to send events to the input of a particular node
in the scene without needing to get dirty in the guts of Xj3D.
The better way of doing this, is to use the VRMLScene object and query
it for particular nodes. If you already have the PointSet node marked
with a DEF, then use the getDEFNodes() map and looking up the
appropriate node that you are interested in. Then, you find out the
index of the field that you want to write to using getFieldIndex(). Once
you have the index, you can directly write the value to the node using
the appropriate setValue() call. Here's a bit of psuedo code to try to
explain this better:
VRMLScene scene = loader.loadNow(inputsource);
Map defs = scene.getDEFNodes();
VRMLNodeType my_pointset = defs.get("NODE_OF_INTEREST");
int field_index = my_script.getFieldIndex("point");
my_pointset.setValue(field_index, new float[] {.....});
--
Justin Couch http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler http://www.yumetech.com/
Author, Java 3D FAQ Maintainer http://www.j3d.org/
-------------------------------------------------------------------
"Humanism is dead. Animals think, feel; so do machines now.
Neither man nor woman is the measure of all things. Every organism
processes data according to its domain, its environment; you, with
all your brains, would be useless in a mouse's universe..."
- Greg Bear, Slant
-------------------------------------------------------------------
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".