Main Content

addViewpoint (Aero.VirtualRealityAnimation)

Add viewpoint for virtual reality animation

Syntax

addViewpoint(h, parent_node, parent_field, node_name)
h.addViewpoint(parent_node, parent_field, node_name)
addViewpoint(h, parent_node, parent_field, node_name, description)
h.addViewpoint(parent_node, parent_field, node_name, description)
addViewpoint(h, parent_node, parent_field, node_name, description, position)
h.addViewpoint(parent_node, parent_field, node_name, description, position)
addViewpoint(h, parent_node, parent_field, node_name, description, position, orientation)
h.addViewpoint(parent_node, parent_field, node_name, description, position, orientation)

Description

addViewpoint(h, parent_node, parent_field, node_name) and h.addViewpoint(parent_node, parent_field, node_name) add a viewpoint named node_name whose parent_node is the parent node field of the vrnode object and whose parent_field is a valid parent field of the vrnode object to the virtual world animation object, h.

addViewpoint(h, parent_node, parent_field, node_name, description) and h.addViewpoint(parent_node, parent_field, node_name, description) add a viewpoint named node_name whose parent_node is the parent node field of the vrnode object and whose parent_field is a valid parent field of the vrnode object to the virtual world animation object, h. description is the character vector or string you want to describe the viewpoint.

addViewpoint(h, parent_node, parent_field, node_name, description, position) and h.addViewpoint(parent_node, parent_field, node_name, description, position) add a viewpoint named node_name whose parent_node is the parent node field of the vrnode object and whose parent_field is a valid parent field of the vrnode object to the virtual world animation object, h. description is the character vector or string you want to describe the viewpoint and position is the position of the viewpoint. Specify position using VRML coordinates (x y z).

addViewpoint(h, parent_node, parent_field, node_name, description, position, orientation) and h.addViewpoint(parent_node, parent_field, node_name, description, position, orientation) add a viewpoint named node_name whose parent_node is the parent node field of the vrnode object and whose parent_field is a valid parent field of the vrnode object to the virtual world animation object, h. description is the character vector or string you want to describe the viewpoint, position is the position of the viewpoint, and orientation is the orientation of the viewpoint. Specify position using VRML coordinates (x y z). Specify orientation in a VRML axes angle format (x y z Θ).

Note

If you call addViewpoint with only the description argument, you must set the position and orientation of the viewpoint with the Simulink® 3D Animation™ vrnode/setfield (Simulink 3D Animation) function. This requires you to use VRML coordinates.

Examples

Add a viewpoint named chaseView.

h = Aero.VirtualRealityAnimation;
h.VRWorldFilename = [matlabroot,'/examples/aero/data/asttkoff.wrl'];
copyfile(h.VRWorldFilename,[tempdir,'asttkoff.wrl'],'f');
h.VRWorldFilename = [tempdir,'asttkoff.wrl'];
h.initialize();
h.addViewpoint(h.Nodes{2}.VRNode,'children','chaseView','View From Helicopter');

Version History

Introduced in R2007b