Anim2D
Anim2D block
Library
SignalViewers
Description
The animation block is used to animate different types of graphical objects in a Figure (on a canvas). An input is associated with an object type. Type 1 is a closed polyline and the input is a Nx2 matrix where each row represents the x, y coordinates of a point. Type 2 is similar to 1 but the poyline is not closed. Type 3 corresponds to circles and the input is a Mx3 matrix. Each row corresponds to a circle and contains the x, y coordinates of the center of the circle and its radius. Type 4 corresponds to rectangles and the input is a Kx4 matrix. Each row corresonds to a rectangle and contains the x, y coordinates of the lower left corner of the rectangle, and its width and height.
When the block is activated through its first input activation port, the animation advances by moving all the objects to the positions specified by the current input signals. When activated through its second activation port, the objects are duplicated and a copy is frozen in place in order to create snapshots.Object types can be given as negative values (-1 instead of 1, -2 instead of 2, etc.). Objects with negative types are not included in snapshots.Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
nin | Number of inputs | Specify the number of input signals. | Number | |
types | Object types | Matrix of size Mx1 | ||
sz | Canvas geometry | Matrix of size 1x4 | ||
clrs | Color table | Matrix of size Mx3 | ||
zoom | Zoom factor | Scalar | ||
position | Window position | Matrix of size 1x2 |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
Port 1 | explicit | input | nin | |
Port 2 | activation | At each activation the animation is advanced. | input | 1 |
Port 3 | activation | At each activation a snaphot is taken. | input | 2 |