Documentation

Link to Models

Connect virtual reality worlds to Simulink® and Simscape™ Multibody™ dynamic system models

To visualize a dynamic system simulation, connect a Simulink block diagram or Simscape Multibody Link to a virtual world. Simulating the model generates signal data for a dynamic system, which you can use to control and animate the virtual world.

To connect to a Simulink model, useSimulink 3D Animation™ blocks. To write values from the block ports to specified virtual world fields, use a VR Sink block. To provide interactivity between a virtual world visitor and a Simulink model, use a VR Source block or other blocks such as a Space Mouse Input block.

To view the behavior of a model created with the Simscape Multibody Link software:

  1. Build a model of a machine in the Simulink interface using Simscape Multibody Link blocks.

  2. Create a detailed visual representation of your machine in a virtual world.

  3. Connect the virtual world to the Simscape Multibody Link body sensor outputs.

  4. View the behavior of the bodies in a virtual world viewer.

Functions

vrlibOpen Simulink block library for Simulink 3D Animation
vrjoystickCreate joystick object
vrspacemouseCreate space mouse object

Blocks

VR SinkWrite data from Simulink model to virtual world
VR SourceRead data from virtual world to Simulink model
VR To VideoWrite data from Simulink model to virtual world (video output port enabled)
VR TracerTrace trajectory of object in associated virtual scene
VR PlaceholderSend unspecified value to Simulink 3D Animation block
VR Signal ExpanderExpand input vectors into fully qualified virtual world field vectors
Joystick InputProcess input from asynchronous joystick device
Space Mouse InputProcess input from space mouse device
Cross ProductCross product of two 3-D vectors
Normalize VectorUnit vector parallel to input vector
Rotation Between 2 VectorsVirtual world rotation between two 3-D vectors
Rotation Matrix to VRML RotationConvert rotation matrix into representation used in virtual world
Viewpoint Direction to VRML OrientationConvert viewpoint direction to virtual world orientation

Simulink Models and Generated Code Links

Virtual Reality World and Dynamic System Examples

Use virtual worlds that interface to Simulink block diagrams and to MATLAB® objects and functions.

Connect Virtual Worlds and Models

Associate a Simulink model with a virtual world and connect signals from the Simulink model to the virtual world.

Interact with Generated Code

Have a virtual world that you create with the Simulink 3D Animation product interact with code generated by the Simulink Coder™ product and compiled with a third-party C/C++ compiler in the Simulink Desktop Real-Time™ environment.

Simscape Multibody and Imported CAD Model Links

Link to Simulink and Simscape Multibody Models

Establish a live data connection between the model and the virtual world by creating associations between dynamic model object quantities and corresponding virtual world object properties.

Modify the CAD Model Virtual World

Use the 3D World Editor or other editor to modify the results of CAD tool export filters manually.

Was this topic helpful?