LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I control the ball movement using slider?

I want to control the ball which is present in a 2D picture.When ever the ball hits slide control it should bounce other wise it should stop.

RAVITEJA S

0 Kudos
Message 1 of 2
(1,516 Views)

Hi ravi,

 

I want to control the ball which is present in a 2D picture.

When you "want to" implement an algorithm it always help to draw a sketch on a sheet of paper - before starting to code…

 

When ever the ball hits slide control it should bounce other wise it should stop.

When the "ball hits the wall" you need to change it's movement vector…

 

Are you searching for someone doing the coding for you? Then you should post here…

Otherwise you should tell us, what your problem is and you should ask specific questions. (There is no question mark in your message! ;))

 

On your VI:

- Why do you convert between cluster and array this often?

- Why do you use InRangeAndCoerce with array constants for the limits when there is just a single element in the array? Why not use scalar constants?

- Why donÄt you cleanup your VI before posting here? When someone else should examine your VI you should not distract them with such a mess…

- Why do you need special slide controls? Why not work with coordinates in your picture indicator? Why not actually draw your walls in the picture?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 2 of 2
(1,498 Views)