Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Bouncing Balls

This example shows how to use Draw Shapes blocks to insert circles and rectangles into an image.

Example Model

The following figure shows the Bouncing Balls example model:

Bouncing Balls Results

The Draw Shapes blocks draw circles and rectangles with varying sizes, colors, opacities, and locations. You can change the colors and opacities of these objects by modifying the Fill value color, RGB values, and Opacity factor parameters. The example creates the motion effect by changing the coordinates it inputs to the Pts port at each sample time.

You can use the Set parameters block to specify the Radius and Radius1 parameters. By changing these parameters, you change the size of the moving objects. Note that the Number of rows of input image and Number of columns of input image parameters must match the input signal dimensions.

Available Example Versions

Windows® only: vipbouncingballs_win.mdlvipbouncingballs_win.mdl

Platform independent: vipbouncingballs_all.mdlvipbouncingballs_all.mdl

Windows-only example models might contain compressed multimedia files or To Video Display blocks, both of which are only supported on Windows platforms. The To Video Display block supports code generation, and its performance is optimized for Windows.

Was this topic helpful?