Phase 3. Creating 3D animation
You’ve now seen many of the features that help make AnyLogic
such a powerful modeling tool. But there are others you haven’t
touched, and one of the most exciting is 3D animation.
objects allow you to define the view that
displays in the 3D window.
In essence, the camera object "shoots" the
picture that you see.
You can also create several camera objects to show different
areas of the same 3D scene or to show a single object from different
points of view. If you use more than one camera object, you can easily
switch from one view to another at runtime.
- On the Presentation
drag the Camera object on to the Main diagram so it
faces the job shop layout.
- Drag the 3D
on to the Main
diagram, and then place it below the process flowchart.
In addition to having the option to add several cameras to your model,
you can also add several 3D windows that will each display the same 3D
scene from a different point of view.
- Let the camera "shoot" the picture for the 3D window. In
the 3D window’s Properties
area, click camera
in the Camera
- Prevent the camera from shooting the picture from under the
floor by selecting the option Limited
to Z above 0 from the Navigation
- Run the model.
When you create a 3D window, AnyLogic adds a view area
that allows you to easily navigate to the 3D view at runtime. To switch
to this 3D view while the model is running, open the developer panel by clicking the Developer panel control in the right corner of the control panel. In the developer panel, expand the select view area to navigate list and select [window3d] from the list.
- The view area expands the 3D animation scene to the model window's
Do one or more of the following to navigate in 3D at
- To move the camera left, right, forward or backward,
drag the mouse in the selected direction.
- To move the camera closer to or further from the
scene's center, rotate the mouse’s wheel.
- To rotate the scene relative to the camera, drag the
mouse while you press and hold ALT (Mac OS: Option key) and the left mouse button.
- Choose the view you want to display at runtime, right-click
(Mac OS: CTRL+click) inside the 3D scene, and then click Copy the camera’s location.
- Close the model’s window.
- On the camera’s Properties
area, apply the camera location you selected during the previous step
by clicking Paste
coordinates from clipboard.
NOTE: If you can’t locate the camera, you can use the Projects tree. It
will display camera
under the Main
- Run the model to view the 3D view from the new camera
position, and then close the model window.
- Expand the Space
Markup palette’s Pedestrian area and then double-click the
icon to enable
wall drawing mode.
- Do the following to draw walls around the job shop layout’s
- Click the position in the graphical editor where you
want to start drawing the wall.
- Move the pointer in any direction to draw a straight
line, and then click at any point where you want to change direction.
- Double-click at the point where you want to stop
drawing the wall.
- Do the following to change the wall’s fill color and
- On the wall’s Properties
area, expand the Appearance
- In the color menu, click Other colors.
- In the Colors
dialog, select the color that you want to
apply to the wall from the palette or the spectrum.
You can also set a transparency level (use
slider in the Colors
dialog) or customize the wall with
any provided texture (click the Textures…
item in the colors menu).
this section, we’re using walls to decorate our model.
In the pedestrian Airport tutorial you’ll see how walls can also be
- Go to the wall’s Position
and size section and change the Z-Height to 40.
AnyLogic automatically sets the shape's height to 20
pixels to ensure it has volume in a 3D view, but we’ve now increased
its height to 40 pixels.
- Draw another wall between the exits and then change the
settings in the second wall’s Properties
area to match the first wall.
- Run the model and view the 3D animation.
You’ll see that our model’s animation uses cylinder shapes
to represent pallets, but we’ll correct the problem by creating an
agent type that defines a custom animation for pallets.
- In the sourcePallets
area, under the New agent
list, click the create a
custom type link.
- In the New
agent wizard, do the following:
- In the Agent
type name field, type Pallet.
- Click Next.
- On the next page of the wizard, expand the Warehouses and Container Terminals
section in the list on the left, and then click the 3D animation figure
- Click Finish.
AnyLogic creates the Pallet
agent type and opens the Pallet
diagram that will display the animation that we selected in the wizard.
Our next step will be to add product animation on top of the pallet
animation, but we’ll first enlarge the view to give us a closer look at
- Using the Zoom
toolbar, enlarge the Pallet
diagram to 500%, and then move the canvas to the right and down to view
the axis’ origin point and pallet animation shape.
or reducing the view
toolbar lets you enlarge or reduce the view of a graphical diagram:
- Do the following to start adding product animation on top
of the pallet animation.
- On the 3D
Objects palette, expand the Boxes area.
- Drag the Box
1 Closed object on to the pallet’s upper-left corner.
- Since this box appears to be too large when compared to the
pallet, let’s change the box’s Scale
- In the box’s Properties
area, expand the Position
section, and then change the box’s Z
coordinate to 2.
Our change reflects the fact that we want to place boxes
on the pallets and each pallet’s height is about 2 pixels.
three boxes by copying the first box three times. To copy the box,
select it and then press and hold CTRL as you drag the box.
Our pallet now has four closed boxes, and you can now
change the zoom level back to 100% by clicking the toolbar’s Zoom to 100% button.
- Return to the Main
If you open the sourcePallets
area, you’ll see Pallet
is selected as New agent.
This block will generate agents of the Pallet type.
- Run the model.
see pallet shapes have replaced the multicolored cylinders. However, if
you zoom in the 3D scene, you’ll notice that the forklift trucks aren’t
transporting pallets. We’ll correct this problem by moving our model’s
pallet animation in a way that allows the forklift trucks to pick up
- In the Projects
view, double-click the ForkliftTruck
agent type to open its diagram and then move the forkliftWithWorker
figure one cell to the right.
The animation shape is now in the correct location and our
model’s pallets are aligned with the forklift trucks’ forks.
- Open Main
diagram, and in the pallet rack’s Properties
area, in the Number of
levels box, type 2.
TIP: Remember that your first click will select the
network and your second click will select the network element.
- In the storeRawMaterial
flowchart block’s Properties
area, set the Elevation
time per level parameter to 30 seconds.
- In the pickRawMaterial
area, set the Drop time
per level parameter to 30 seconds.
- Run the model and you’ll see a pallet rack with two levels.
Phase 2. Adding resources
Phase 4. Modeling pallet delivery