11-19-2013 09:51 AM
Hello Everyone,
Let's say first co-ordinate is (5, 5), I want to move this pixel on this X-Y graph to (10, 5); how can I do it?
I know that I need to increase it slowly by step of one towards the right on x-axis, but how can I do it with it showing every step and ending up at (10, 5)?
For example:
First Step
o <----- pixel
Second Step
o
Third Step
o
etc..... till final step at (10, 5).
Thanks in advance for helping!
11-19-2013 10:06 AM
11-19-2013 10:48 AM
If you want to show the pixel moving, not just the start/end points. you will have to utilize a loop where you add one each time (or a fraction for a smoother movement) and a wait timer to ensure enough time elapses for the user to view the change.
11-19-2013 10:50 AM
x=xstart+frac*(xend-xstart)
y=ystart+frac*(yend-ystart)
frac=fraction of the way between start point and end point, 0->1.
frac=(current time-start stime)/(end time-start time)
loop over time in small increments.
11-20-2013 01:14 AM
Thanks everyone for helping!
I am able to reach the end point of my second co-ordinate, however now I wish it to move down the Y-axis after it reaches the end of second co-ordinate.
I used a case structure however it is giving me a hard time (also because I am unfamiliar with it).
Is there any simpler methods other than case structure? If not, how do I use it to continue the flow down the Y-axis please?
11-20-2013 01:57 AM
11-20-2013 03:19 AM
Thanks for your reply, GerdW!
Let's say if I want to just allow the user to choose the four corners of a rectangle, and then for the pixel to show one at a time and end back at the initial point; should I use Enum, Boolean or Numerical case?
11-20-2013 03:42 AM
11-20-2013 03:45 AM
REALLY?! If that is true, I will be so so happy!!!
I will building all four directions now and I will try your solution!
Thanks for your post!
11-20-2013 03:55 AM
Let's say for my .vi as shown below, what can I do for the "N" at the top left corner for the pixel to complete a round; repeating the cycle again and again if possible?
Thanks!