Main Content

addNode (Aero.VirtualRealityAnimation)

Add existing node to current virtual reality world


addNode(h, node_name, wrl_file)
h.addNode(node_name, wrl_file)


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.


collapse all

This example shows how to add a node to the world defined in chaseHelicopter.wrl.

h = Aero.VirtualRealityAnimation;
h.VRWorldFilename ='asttkoff.wrl';

Figure VR Plane Take-Off contains objects of type hgjavacomponent, uimenu, uipanel, uitoolbar.

Version History

Introduced in R2007b