I am trying to write ofVec2f points from a Kinect to a JSON File, and then read them in on a different sketch, reformat them, and draw them the same way as the original. I can write out the JSON file successfully, but am wondering what a more efficient way of doing it is. Currently in my Update I am just checking to see if my JSON element is less then 5000 and when it hits 5000 I save it to the JSON and clear the JSON element. I am doing it like this:
This solution is laggy as pushing all 5000 vector elements to the JSON at once is a lot. I was wondering if any of you could help me get this to be more efficient. I have tried different values other then 5000 and they seem to all be laggy.
Additionally, I am planning on using WebSockets to send the JSON file to a different computer in a different place, but don’t know much about them yet. I have heard that I can do some of this computation on the WebSocket side, and am open to trying to figure out how to make more efficient from this standpoint.