Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Animate an object around the perimeter of a rectangle

Can anyone tell me how to animate an object around the perimeter of a rectangle, using a programmed value that contains the distance of the rectangle perimeter?  I can animate the object in a straight line using the full range of the value, but I need to break the value into pieces to represent all sides of the rectangle.
 
Thanks,
Chris
0 Kudos
Message 1 of 2
(5,939 Views)
I made an example. Hope this helps you.
I assume length:width = 3:2.  Divide the perimeter into 100 pieces, 40 for width, 60 for length. Use a counter to count the pulse. The counter resets at 100. Then, use an expression to calculate the X and Y.
Ryan Shi
National Instruments
0 Kudos
Message 2 of 2
(5,929 Views)