Defining animation scale

Quite often we cannot animate large objects (warehouses, railway stations, etc.) in their actual size. That is why when animating such objects we reduce their sizes several times, i.e. scale the animation of the objects being modeled.

With the special element Scale you can set the scale of the animation, i.e. the ratio of the object's animation to the actual size of the object. Actually the scale is set as a ratio of pixels of the animation to the physical units of length.


You can see that there is always a chosen unit of length to pixel correspondence notice under the scale element for your convenience. 

There are two alternative methods to set the animation scale through use of the element Scale:

You define scale once for all the shapes on the agent diagram, so there can be only one ruler on the agent diagram. However, different agents may have different scales.

You can use the Properties view to set the required scale, or drag its end to set the number of pixels that should correspond to one unit of length. There are two modes that you can use to set up the scale. In the Properties view of the scale, you will find the property Scale is: Defined graphically or Specified explicitly:

 To set the scale of agent animation according to its real size

Let us define the scale, for instance, for a train car animation in the model.

  1. Move the diagram down and you will find the Scale element located above X-axis on the agent's diagram. 
  2. Move the scale ruler so that it coincides exactly with the animation figure length. First, position the scale along the figure. To move with pixel precision, hold down Alt key while dragging the element with the mouse. We can also recommend you also to zoom the graphical editor diagram using the Zoom In  toolbar button.
  3. Match the end points of the ruler with the figure length. Stretch the scale ruler by dragging its end with the mouse. We again recommend holding down the Alt key while dragging. 
  4. Now set the required scale. In this particular case the train car real length corresponds to 27 meters. Go to the ruler Properties view. Leave the Scale: Defined graphically option selected. Specify 27 meters in the Ruler length corresponds to field below.

  5. You can see that the dimensions are the same now on both dimension lines. Now you can easily set object lengths and distances for a given type of agent, and AnyLogic will use the scale that you have set here.
  6. If we run the model now, we will get realistic size right away:



Visible on upper level – If selected, the scale is also visible on the upper level where this agent lives.

Lock – If selected, the scale is locked. Locked shapes do not react to mouse clicks - it is impossible to select them in the graphical editor until you unlock them. It is frequently needed when you want to prevent editing this shape while drawing other shapes near it.

Visible – Here you specify whether the shape is visible on the animation at the model runtime, or not. Using the control, choose yes or no.

Length, pixels – The length of the shape on an agent's diagram, in pixels.

Scale is – Here you can choose how this element defines the scale of your model's animation.  

Defined graphically Use this mode if you know the real size of the objects that the animation figures represent.  

Specified explicitly
- Use this mode if you know the exact scale for this agent's animation.

AnyLogic supports both popular measurements: metric system (units of length: cm, m, km) and English (inches, feet, miles).

X – X-coordinate of the Scale element.

Y – Y-coordinate of the Scale element.

Rotation – The rotation angle of the Scale element.

Related topics

Scaling agent animations on GIS map