A new branch

I generated a video of the 2D branching script I posted the other day. Unfortunately it wasn’t as easy as I had hoped it would be. Apparently all of iGeo’s computations are done separately from the main runtime in processing, so it wont let make active references from within the iGeo methods. This means that doing something like adding a new frame to a video every time the agents update is impossible because as far as processing is concerned everything inside iGeo isn’t actually ever changing. So I had to add the frames to the movie once every processing cycle. In this case it isn’t that big of a problem because my computer has no trouble doing all the calculations for the 2D branching in real time and I was able to generate a video of what I see in my processing window in real time.

However when I tried to generate a video from a 3D version of the branching script I made this became a big problem. My computer couldn’t calculate all the agent interactions 30 times a second for the video and started to lag behind. This is pretty standard for large multi-agent code, and is actually the primary reason I usually generate videos from processing. The script is to slow to show off in real time so I compile the results into a video that will play back in real time. But this time my workaround of adding a frame to the video each time there is a new frame displayed in processing doesn’t work. It just duplicates exactly what I see in the window.

I have a couple more things I want to try to see if I can get it to do what I want, but I’m not terribly familiar with static objects in javascript. It may not even be possible and I may have to rewrite the whole thing to do the agent calculations inside the processing runtime rather than inside a static iGeo instance. If that’s the case then I probably wont be using iGeo’s agent class again. As I said before it’s little more than a minor convenience and not being able to interact with active functions and variables from processing or from other plugins is a huge downside.

Leave a Reply