Main Content

Link to Models

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

Visualize a dynamic system simulation by connecting a Simulink block diagram orSimscape Multibody Linkto a virtual world. Simulating the model generates signal data for a dynamic system, which you can use to control and animate the virtual world.

Use theSimulink 3D Animation™block library to connect to a Simulink model to a virtual world. TheVR Sink块从车辆仿真软件允许你写值万博1manbetxck ports to specified virtual world fields. To provide interactivity between a virtual world viewer and a Simulink model, use aVR Sourceblock or other blocks such as aSpace Mouse Inputblock.

To view the behavior of a model created with theSimscape Multibody Linksoftware:

  1. Build a model of a machine in the Simulink interface usingSimscape Multibody Linkblocks.

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

  3. Connect the virtual world to theSimscape Multibody Linkbody sensor outputs.

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

Functions

vrlib Open万博1manbetxblock library for万博1manbetx3D Animation
vrjoystick Create joystick object
vrspacemouse Create space mouse object
vrcoordm2vr ConvertMATLABcoordinates to VR coordinates
vrcoordvr2m Convert VR coordinates toMATLABcoordinates
vrrotmat2vec Convert rotation from matrix to axis-angle representation
vrrotvec2mat Convert rotation from axis-angle to matrix representation

Blocks

VR Sink Write data from万博1manbetxmodel to virtual world
VR Source Read data from virtual world to万博1manbetxmodel
VR To Video Write data from万博1manbetxmodel to virtual world (video output port enabled)
VR Tracer Trace trajectory of object in associated virtual scene
VR Placeholder Send unspecified value to万博1manbetx3D Animationblock
VR Signal Expander Expand input vectors into fully qualified virtual world field vectors
Joystick Input Process input from asynchronous joystick device
Space Mouse Input Process input from space mouse device
Cross Product Cross product of two 3-D vectors
Normalize Vector Output unit vector parallel to input vector
Rotation Between 2 Vectors Virtual world rotation between two 3-D vectors
Rotation Matrix to VR Rotation Convert rotation matrix to axis/angle rotation
VR Rotation to Rotation Matrix Convert axis/angle rotation to rotation matrix
VR to MATLAB Coordinates Convert VR coordinates toMATLABcoordinates
MATLAB to VR Coordinates ConvertMATLABcoordinates to VR coordinates
Viewpoint Direction to VRML Orientation Convert viewpoint direction to virtual world orientation

万博1manbetxModels 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.

Use Sensors

Move or modify virtual world objects during simulation based on user input from the virtual world or events in the virtual world.

Interact with Generated Code

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

SimscapeMultibodyand 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.