-
Avoid re-calculating array every frame
Hi all!
I’m working on a project where I use a csv to draw a line graph (via a path). Simple enough.
Except it takes a loooong time to do this – a problem since I’m animating the graph.
It seems the slow part is reading the data from the csv into the array, rather than the actual processing of the data or the drawing to path.
My question is: would it be possible to read the csv data and assign it to the array only once? And then each frame I can just adjust the animation?
I guess what I’m asking for is some way of storing the array I get – assigning it to a global variable or something.
Thanks in advance!
p.s. I’ve attached a simplified form of the code – can also paste the text for this if it’s helpful