LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot arrays on image in real time or add image to XY graph at a certain place

Hello,

I'm looking for someone that could answer my questions. Currently I'm making my own version of Flappy Bird that bases on plotting 3 graphs in a real time. Everything is working fine but now I'd like to add some images so it could look better. I'm sending points in arrays just to keep them on plot and have their values. My struggle is, how to transform XY graph to an image without losing game quickness or add images to XY graph at certain point. Sending snippet below.

Thanks a lot.

Maxerx

0 Kudos
Message 1 of 4
(2,623 Views)

You did not attach your image, but I am sure that your code could be streamlined dramatically. For example, you are constantly resizing arrays while a simple "rotate array" might be sufficient.

 

You need to familiarize yourself better with array operations. As a small example, let's see how you initialize your arrays and how it could be done instead.

 

flappy.png

 

Also note that some of your diagram constant are scattered all over the the diagram with the same values. This is a nightmare if you event want to tweak the values a little bit. Exactly one diagram constant for each value is sufficient!.

0 Kudos
Message 2 of 4
(2,603 Views)

Thank You for Your answer. Yes, I'm aware of that, my experience with this kind of programming tool is far smaller than I'd like to. Unfortuanately, this is a project I'm ought to accomplish, therefore I'm doing as much as I know. You are right though, I'll try to optimalize it a lil' bit :). Have you got any clue how to do something about my problem?

0 Kudos
Message 3 of 4
(2,598 Views)

I am not sure if XY graphs are even needed. All your pixel positions are integers so there is no need for floating point calculations anywhere. I would probably try to do everything in a simple 2D picture indicator. 

0 Kudos
Message 4 of 4
(2,594 Views)