imit_model / AnyLogic / UsersManual(AnyLogic)
.pdf
AnyLogic V User’s Manual
Properties
Point array – the array of vertices is drawn as individual points.
Line array – the array of vertices is drawn as individual line segments. Each pair of vertices defines a line to be drawn. The number of vertices of a line array mesh must be divisible by 2.
Triangle array – the array of vertices is drawn as individual triangles. Each group of three vertices defines a triangle to be drawn. The number of vertices of a triangle array mesh must be divisible by 3.
Quad array – the array of vertices is drawn as individual quadrilaterals. Each group of four vertices defines a quadrilateral to be drawn. The number of vertices of a quad array mesh must be divisible by 4.
Line strip array – the array of vertices is drawn as a set of connected line strips. An array of per-strip vertex counts specifies where the separate strips appear in the vertex array. For every strip in the set, each vertex, beginning with the second vertex in the array, defines a line segment to be drawn from the previous vertex to the current vertex.
Triangle strip array – the array of vertices is drawn as a set of connected triangle strips. An array of per-strip vertex counts specifies where the separate strips appear in the vertex array. For every strip in the set, each vertex, beginning with the third vertex in the array, defines a triangle to be drawn using the current vertex and the two previous vertices.
Triangle fan array – the array of vertices is drawn as a set of connected triangle fans. An array of per-strip vertex counts specifies where the separate strips (fans) appear in the vertex array. For every strip in the set, each vertex, beginning with the third vertex in the array, defines a triangle to be drawn using the current vertex, the previous vertex and the first vertex. This can be thought of as a collection of convex polygons.
# points – [read only] static value|[optional] dynamic expression of number of vertices of the mesh.
X[index] – [optional] dynamic expression of the x-coordinate of the mesh’s vertex.
Y[index] – [optional] dynamic expression of the y-coordinate of the mesh’s vertex.
Z[index] – [optional] dynamic expression of the z-coordinate of the mesh’s vertex.
© 1992-2004 XJ Technologies http://www.xjtek.com |
317 |
AnyLogic V User’s Manual
Color – static value|[optional] dynamic expression of the text color (java.awt.Color). If the checkbox is not checked, the static color is transparent. If the expression evaluates to null, the dynamic color is transparent.
Font – the font of the text.
Choose – the button opens the Font dialog box for changing the font properties.
12.3.2.10 Pivot
Pivot is used to group animation shapes, rotate the group, and shift the coordinate system. By specifying dynamic properties of a pivot (X, Y, Rotation, etc.), you can move a group of shapes and rotate it around the pivot. A pivot itself is not visible in an animation.
►To draw a pivot
1.Click the Pivot
toolbar button, or
Choose Draw|3D Animation|Pivot from the main menu.
2.Click the place on the diagram where you want to put the pivot.
►To add/remove shapes from the pivot group
1.Right-click the pivot and choose Add/Remove Shapes from the popup menu.
2.Click on a shape to add/remove it to/from the pivot group.
3.Click the empty area to finish.
When a shape is added to a pivot group, the pivot becomes the origin of its dynamic coordinates, instead of the animation origin point (0, 0). This can be used to shift the coordinate system for a part of an animation.
Properties
Custom shape template – if set, the group of shapes added to pivot is considered as a custom shape. You can create as many such custom shapes as you like at runtime.
© 1992-2004 XJ Technologies http://www.xjtek.com |
319 |
AnyLogic V User’s Manual
Original size – if checked, the original image size is preserved.
If you intend to move your project file, first embed your images. Otherwise, you will need to update paths to all image files used. Embedded images are stored in the AnyLogic project file. If needed, they can be exported to a graphical file anew.
►To embed an image
1.Select the image filename in the Images list.
2.Click the Embed button.
►To export an embedded image
1.Select the image name in the Images list.
2.Click the Export button.
The Save As… dialog box is displayed.
3.Specify the name of the image file.
4.Browse for the folder where you want to store the file.
5.Click the Save button.
12.3.2.12 Encapsulated 3D animation
►To draw an encapsulated 3D animation
1.Click the Encapsulated 3D Animation
toolbar button, or
Choose Draw|3D Animation|Encapsulated Animation from the main menu.
2.Click or drag a rectangle area on the diagram.
Properties
Object – name of the encapsulated object this shape refers to. In case the object is replicated, you may specify a particular element, e.g., cars-5.
© 1992-2004 XJ Technologies http://www.xjtek.com |
321 |
AnyLogic V User’s Manual
in the animation editor (Figure 148 shows the orientation with respect to the viewer (the x- axis is positive to the right, y-axis is positive down, and z-axis is negative toward the viewer). To fit all animation shapes into the image plate and to make them appear with the same sizes as in animation editor, the camera is moved along the z-axis back to negative values.
However, you may need to position the camera differently; therefore, AnyLogic enables you to specify the camera’s parameters on your own.
►To calculate camera parameters automatically/manually
1.Click 3D animation in the Project window.
2.Click the Camera tab of the Properties window and go to the Position section.
3.Select/clear the Automatically calculate camera parameters check box.
Note that when you set the camera’s parameters on your own, camera orientation differs from the orientation set for automatically managed camera. In this case the default axis orientation is the following: the x-axis is positive to the right, y-axis is positive up, z-axis is positive toward the viewer. The default camera location is the image plate center ((0,0,0) point). Since the camera must be positioned behind the image plate to see animation shapes rendered onto the image plate, you need to move the camera to positive z values.
You can define the clip distances and the camera’s position and orientation on the Camera page of the 3D animation’s properties page.
12.3.4.1 Defining clip distances
The back clip distance specifies the distance from the camera in the direction of gaze to where objects begin disappearing. Objects farther away from the camera than the back clip distance are not drawn. The default value is 10.0 meters.
The front clip distance specifies the distance away from the eyepoint in the direction of gaze where objects stop disappearing. Objects closer to the eye than the front clip distance are not drawn. The default value is 0.1 meters.
There are several considerations that need to be taken into account when choosing values for the front and back clip distances:
© 1992-2004 XJ Technologies http://www.xjtek.com |
323 |
AnyLogic V User’s Manual
►To rotate the camera
1.In the Project window, click 3D animation item in the workspace tree.
2.Click the Camera tab of the Properties window and go to the Orientation section.
3.Choose the Rotation option.
4.Specify static values (in degrees) or dynamic expressions (in radians) of the counter clockwise rotations of the camera about the x-axis, y-axis and z-axis in the X, Y and Z edit boxes correspondingly.
►To define a point the camera is looking at
1.In the Project window, click 3D animation item in the workspace tree.
2.Click the Camera tab of the Properties window and go to the Orientation section.
3.Choose the Look at option.
4.Specify static values or dynamic expressions of the x-, y- and z-coordinates of the point the camera is looking at in the X, Y and Z edit boxes correspondingly.
5.Specify the camera’s up direction vector in the Up X, Up Y, Up Z edit boxes. The default direction vector is (0,1,0). Changing it, e.g., to (0,-1,0) flips the rendered image upside-down.
12.3.5Writing code for 3D animation
You can write code for 3D animation object in the Code window of 3D animation.
►To open the Code window of 3D animation
1.In the Project window, right-click the Code item in the animation subtree of the workspace tree and choose Open Code from the popup menu, or
Double-click the Code item in the animation subtree.
3D animation’s Code window is displayed (see Figure 149)
© 1992-2004 XJ Technologies http://www.xjtek.com |
325 |

toolbar button, or Choose
toolbar button, or