SimMechanics | ![]() ![]() |
Visualizing a Simple Pendulum
In this section, you learn how to view the swinging pendulum rod of the model introduced in the last section using the SimMechanics visualization tools. Use your saved spen.mdl
model, or use the mech_spen
model in the Demos library. Online Help users can click here to open the model.
SimMechanics has two independent tools for visualizing a machine. One is an internal tool based on MATLAB Handle Graphics. The other is an optional virtual reality scene and requires the Virtual Reality Toolbox 3.0 to be installed. Both tools display a machine by representing its bodies. The bodies can be displayed in two ways, by equivalent ellipsoids and by closed surfaces (convex hulls) enveloping the bodies' coordinate systems.
Note You can find more on visualizing and animating machine models in Visualizing and Animating Machines. |
This section explains how to visualize your pendulum with either tool, using either body representation. You can view the pendulum before you start and, separately, choose to animate it during simulation as well:
Starting Visualization
The first step is to open the Mechanical Environment Settings dialog box from your model window:
![]() | Adding Sensors and Starting the Simulation | Representing the Bodies | ![]() |