MATLAB SIMULINK 3D ANIMATION 5 Bedienungsanleitung Seite 35

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 43
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 34
33
In order to associate a Simulink signal to a virtual object property:
From the vrlib library, insert a VR Sink block to your Simulink model.
Double-clik on the VR Sink block. This opens the VR Sink Block
Parameters dialog, where you can define the associated virtual scene.
Enter the name of the scene VRML file in the Source file: edit box, or use
the Browse… button to select the file interactively. Press the Apply
button to load the selected VRML scene.
For smooth visualization of the movement it is sometimes necessary to
change the block Sample time. For instance, in order to update the
virtual scene 25 times per simulation second, set the sample time to 0.04
s. Be careful when using the inherited sample time for the VR Sink block.
Depending on the solver used, this might result in non-equidistant (in
simulation time) updating of virtual scene, giving the user false
impression of system dynamics.
In the VRML Tree in the right of the dialog box, expand the main object
Transform branch and in the scene object hierarchy (displayed exactly as
read from the VRML file), locate all parts you want to control from
Simulink according to their names given in the “Adding DEF Names”
section. With each part (represented by named Transform nodes) select
the checkbox next to its rotation and position fields. This tells VR Sink
block that you want to control rotation and position of these parts. You
can select also other properties of virtual scene objects (colours etc.), but
rotations and positions are most frequently used.
Press OK. For each selected field, VR Sink block creates an input port.
Increase the VR Sink block size to reflect the number of input ports.
Once the VR Sink block is associated with a virtual scene, double-clicking on it
invokes the Simulink 3D Animation Viewer. Block parameters are available
through Simulation Block Properties menu command in the viewer.
VR Sink inputs take signals of type corresponding to their VRML representation.
Position inputs are of type SFVec3f take the position in the [x y z]
coordinates. Rotation inputs are of type SFRotation take the 4-element
vector defining right-hand rotation as [axis angle]. The angle value is in radians.
It is up to the user to match the coordinate system used by the Simulink model
to that of the virtual scene. If the two systems are not identical, some kind of
axes transformations is necessary.
Seitenansicht 34
1 2 ... 30 31 32 33 34 35 36 37 38 39 40 41 42 43

Kommentare zu diesen Handbüchern

Keine Kommentare