addNode (Aero.VirtualRealityAnimation) - Add existing node to current virtual reality world
Syntax
addNode(h, node_name, wrl_file)
h.addNode(node_name,
wrl_file)
Description
addNode(h, node_name, wrl_file) and h.addNode(node_name,
wrl_file) add an existing node, node_name,
to the current virtual reality world. The wrl_file is
the file from which the new node is taken. addNode adds
a new node named node_name, which contains (or
points to) the wrl_file. node_name must
be unique from other node names in the same .wrl file. wrl_file must
contain the node to be added. You must specify the full path for this
file. The vrnode object associated with the node object must be defined
using a DEF statement in the .wrl file.
This method creates a node object on the world of type Transform.
When you use the addNode method to add a
node, all the objects in the .wrl file will be
added to the virtual reality animation object under one node. If you
want to add separate nodes for the objects in the .wrl file,
place each node in a separate .wrl file.
Example
Add node to world defined in chaseHelicopter.wrl.
h = Aero.VirtualRealityAnimation;
h.VRWorldFilename = [matlabroot,'/toolbox/aero/astdemos/asttkoff.wrl'];
copyfile(h.VRWorldFilename,[tempdir,'asttkoff.wrl'],'f');
h.VRWorldFilename = [tempdir,'asttkoff.wrl'];
h.initialize();
h.addNode('Lynx',[matlabroot,'/toolbox/aero/astdemos/chaseHelicopter.wrl']);See Also
Aero.Node, move, removeNode, updateNodes,
Aero.VirtualRealityAnimation
 | addBody (Aero.Animation) | | addRoute (Aero.VirtualRealityAnimation) |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit