3D Object

3D Object element enables AnyLogic users to import ready-to-use 3D objects created with the help of any third-party 3D graphics packets into their models. 

While the standard AnyLogic shapes (rectangle, oval, polyline, line, etc.) are usually used to draw simple objects (e.g. roads, walls, boxes, etc.), the more complicated objects (e.g. people, forklift trucks, airplanes, etc.) are usually not drawn in AnyLogic, but rather imported from the outside using 3D objects.

3D object supports import of 3D objects stored in X3D and VRML files. X3D format is the XML-based file format for representing 3D computer graphics, it is the successor to the Virtual Reality Modeling Language (VRML).

 To add a 3D object onto your presentation
  1. Drag the  3D Object element from the 3D section of the  Presentation palette onto the graphical editor. You can also drag the 3D object files from other applications directly onto the AnyLogic graphical diagram. In this case AnyLogic automatically adds a new  3D Object element on the graphical diagram containing the added 3D object file.
  1. AnyLogic will prompt to resize the object automatically to make its size correspond to the agent scale. In most cases it is recommended to confirm this action.
    You can set auto-scaling to be performed automatically (as well as disable it) in the AnyLogic preferences.
  2. Now you should tell this shape where the required object is stored. Navigate to the Properties view and choose the file containing the 3D object you want to be displayed by this shape. Click the Browse button to open the Open dialog box. Browse for the required file, select it and click Open when finished.
  3. You will see 3D object's shape in the graphical editor. 

When you add a 3D object onto the agent's graphical diagram, it is displayed as if you are looking at it from above. At model runtime this 2D image will be shown in the regular canvas of the presentation window, while the full 3D object will be shown in the 3D window.

Properties

General

Name – The name of the object. It is used to identify and access the object from code.

Ignore – If selected, the object will be excluded from the model.

Visible on upper level – If selected, the object will be also visible on the upper level where this agent lives.

Lock – If selected, the shape 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 use your shape as a background image for your animation and you want to prevent editing this shape while drawing other shapes over it.

Visible – The object visibility. The object is visible when the specified expression evaluates to true, otherwise it is not visible.

File – The name of the file containing 3D object that is displayed by this shape. To choose a file, use the Browse... button. The  button to the right allows to switch between the absolute and relative file path.

Resize automatically to match agent scale – If selected, the object will be resized automatically to make it correspond to the agent scale. If you change the agent scale afterwards, the object will be resized accordingly. In the AnyLogic preferences, you can set resizing to be performed automatically on adding a new 3D object.

Additional scale - Here you can adjust the scale of the 3D object by the specified percentage. If Resize automatically to match agent scale option is selected, additional scale will be still applied.

Please note that a 3D object cannot be scaled in a common way using the mouse in the graphical editor. Therefore, you can shrink or enlarge it only via the properties. If you need to specify a fractional value, or, e.g. a value that is less than 1%, you should switch the Additional scale field to dynamic value. Note that the dynamic value that you provide will be applied during the model run, i.e. your changes will not be immediately reflected in the graphical editor.

Orientation - Here you can set the orientation of the 3D object in the 3D scene: the object's upper side, etc.

Colors

Here you can define colors of the object if they are available for editing.

Position

X – X-coordinate of the far lower left corner of the object.

Y – Y-coordinate of the far lower left corner of the object.

Z – Z-coordinate of the far lower left corner of the object.

Rotation Z – The rotation angle in XY plane.

Advanced

Show in - Here you can choose whether you want the object to be shown both In 2D and 3D animation or in 2D only, or in 3D only.

Replication – The replication factor of the object. Here you specify the number of copies of the object to create. If you leave this field empty, only one object will be created.

Enable AnyLogic light shaders – If selected, AnyLogic light shaders will be added to this object, providing nice lighting effects. Please note that shaders may be not supported by some X3D files and/or hardware.

Show name – If selected, the object name will be displayed on the presentation diagram.

All 3D object files added to your model will be copied into the model folder. In case you copy your model elsewhere, all image files will be copied as well with the model.


Related topics

 3D animation

 Creating 3D animation

 API Reference: Shape3DFigure Class