User`s guide
1 Getting Started
1-22
Portal Crane with Predefined Trajectory Example (vrcrane_traj)
The vrcrane_traj example is based on the vrcrane_joystick example, but instead
of interactive control, it has a predefined load trajectory. The vrcrane_traj model
illustrates a technique to create the visual impression of joining and splitting moving
objects in the VRML world.
A crane magnet attaches the load box, moves it to a different location, then releases
the box and returns to the initial position. This effect is achieved using an additional,
geometrically identical shadow object that is placed as an independent object outside of
the crane objects hierarchy. At any given time, only one of the Load or Shadow objects is
displayed, using two VRML Switch nodes connected by the ROUTE statement.
After the crane moves the load to a new position, at the time of the load release, a
VRMLScript script assigns the new shadow object position according to the current Load
position. The Shadow object becomes visible. Because it is independent from the rest of
the crane moving parts hierarchy, it stays at its position as the crane moves away.
Lighting Example (vrlights)
The vrlights example uses light sources. In the scene, you can move Sun (modeled as
DirectionalLight) and Lamp (modeled as PointLight) objects around the Simulink
model. This movement creates the illusion of changes between day and night, and night
terrain illumination. The associated VRML file defines several viewpoints that allow you
to observe gradual changes in light from various perspectives.
Magnetic Levitation Model Example (vrmaglev)
The vrmaglev example shows the interaction between dynamic models in the Simulink
environment and virtual worlds. The Simulink model represents the HUMUSOFT
®
CE 152 Magnetic Levitation educational/presentation scale model. The plant model is
controlled by a PID controller with feed-forward to cope with the nonlinearity of the
magnetic levitation system. To more easily observe and control the ball, set the VRML
viewer to the Camera 3 viewpoint.
You can set the ball position setpoint in two ways:
• Using a Signal Generator block
• Clicking in the virtual reality scene at a position that you want
To achieve a dragging effect, use the VRML PlaneSensor attached to the ball geometry
with its output restricted to <0,1> in the vertical coordinate and processed by the VR
Sensor Reader block. The vrextin S-function provides the data connection.