User`s guide
4 MATLAB Interface
4-28
Record Animations for Unconnected Virtual Worlds
This topic describes how to programmatically record animation files for virtual worlds
that are not associated with Simulink models (in other words, from the MATLAB
interface). In this instance, you must specify the relationship between the events that
change the virtual world state and the time in the animation file. This requirement
is different from virtual worlds associated with Simulink models. Virtual worlds
that are controlled completely from the MATLAB interface have no default, intuitive
interpretation of time relation between MATLAB environment models and virtual
scenes.
Note Many engineering time-dependent problems are modeled and solved in MATLAB.
For those that have meaningful visual representation, you can create virtual reality
models and animate their solutions. In addition, the offline animation time can represent
any independent variable along which you can observe and visualize a model solution.
Using offline animation files can bring the communication of such engineering problem
resolutions to new levels. The Simulink 3D Animation example vrheat (heat transfer
visualization) is an example of a time-dependent problem modeled and solved in
MATLAB. Its modified version, vrheat_anim, shows the use of the programming
technique described in this topic.
To record animation files for virtual worlds that are not associated with Simulink
models, note the following guidelines. You should be an advanced Simulink 3D
Animation user.
• Retrieve the vrworld object handle of the virtual scene that you want to record.
• To record 2-D animations,
1
Retrieve the corresponding vrfigure object. For 2-D animations, the Simulink
3D Animation software records exactly what you see in the viewer window.
Because 2-D animations record exactly what you see in the Simulink 3D
Animation Viewer window, the properties that control 2-D file recording belong to
vrfigure objects.
2
Set the Record2D vrfigure property.
3
To override default filenames for animation files, set the vrfigure
Record2DFileName property.
• To create 3-D animation files,