Documentation

MATLAB Interaction

MATLAB® interaction with virtual reality worlds

You can use MATLAB functions and classes to interact with virtual reality worlds. Create a virtual world object (vrobject) and node objects (vrnode) to represent a virtual world that you create with Simulink® 3D Animation™. Change and control the degrees of freedom for the virtual world from within the MATLAB environment by setting values for the available virtual world nodes and their fields using vrnode object methods.

Functions

vrworld Create new vrworld object associated with virtual world
vrdrawnow Update virtual world
vrclear Remove all closed virtual worlds from memory
vrwho List virtual worlds in memory
vrwhos List details about virtual worlds in memory
vrnode Create node or handle to existing node
vr.canvas Create virtual reality canvas
vr.canvas.capture Capture virtual reality canvas image
vrfigure Create virtual reality figure
vrfigure.capture Capture virtual reality figure image
vrfigure.close Close virtual reality figure
vrfigure.get Return property value of vrfigure object
vrfigure.isvalid Check validity of vrfigure object handles
vrfigure.set Set property values of vrfigure object
vrgcf Handle for active virtual reality figure
vrgcbf Current callback vrfigure object
vrclose Close virtual reality figure windows
vr.utils.stereo3d Stereoscopic vision settings for vr.canvas and vr.figure objects
vrdir2ori Convert viewpoint direction to orientation
vrori2dir Convert viewpoint orientation to direction
vrrotvec Calculate rotation between two vectors
vrrotmat2vec Convert rotation from matrix to axis-angle representation
vrrotvec2mat Convert rotation from axis-angle to matrix representation
vrifs2patch Convert virtual world IndexedFaceSet nodes to MATLAB patches
vrpatch2ifs Convert MATLAB patches to IndexedFaceSet nodes

Topics

Create vrworld Object for a Virtual World

Connect MATLAB to a virtual world and interact with that virtual world through the MATLAB command-line interface by creating vrworld and vrnode objects.

Open a Virtual World with MATLAB

Open a virtual world to view the virtual world in a virtual world viewer, scan its structure, and change virtual world properties from the MATLAB Command Window.

Interact with a Virtual World with MATLAB

Interact with virtual world by using vrnode object methods to set vrworld object property values for all the available virtual world nodes and their fields.

Close and Delete a vrworld Object

Close virtual worlds and remove them from memory.

Virtual World Data Types

Explore the data types used by nodes to define objects and the types of data that can appear in the node fields and events.

Related Information

Was this topic helpful?