Main Content

addNode

Class: Aero.VirtualRealityAnimation
Namespace: Aero

Add existing node to current virtual reality world

Syntax

addNode(h,node_name,wrl_file)

Description

addNode(h,node_name,wrl_file) adds a new node named node_name, which contains (or points to) the wrl_file. It creates a node object on the world of type Transform and adds an existing node, node_name, to the current virtual reality world.

The addNode method adds all the objects in the .wrl file 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.

Define the vrnode object associated with the node object using a DEF statement in the .wrl file.

Input Arguments

expand all

Virtual reality animation object, specified as an Aero.VirtualRealityAnimation object.

vrworld node name, specified as a character vector or string. This name must be unique from other node names in the same .wrl file. The wrl_file must contain the node to be added.

Data Types: char | string

The wrl_file is the VRML file from which the new node is taken. wrl_file must contain the node to be added. You must specify the full path for this file.

Data Types: char | string

Examples

expand all

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

h = Aero.VirtualRealityAnimation;
h.VRWorldFilename ='asttkoff.wrl';
initialize(h);
addNode(h,'Lynx','chaseHelicopter.wrl');

Version History

Introduced in R2007b

See Also

| | | | | (Simulink 3D Animation) | (Simulink 3D Animation)