Ford came over today and we looked at my code. He thought the problem might be that I was setting the length of each number to 4 bytes, so he wrote a quick program in C++ that would read in my binary file and display the numbers in ASCII. So he tests it a bit and then pulls up a list of numbers and asks "are these the radii of the cells?"
Oops. Turns out there is not just one number for the radii at the beginning. There is supposed to be one radius for each cell. And then the list of coordinates starts.
I am happy for several reasons:
It was an easy problem to fix.
I was right--it was reading in the wrong numbers for the wrong things. Kind of like a frame shift, but not as bad of one as I was thinking it might be.
I now have a program that will display my binary file in ASCII with markers for when the radii start, when the x y z coordinates start and when each timestep begins.
Once I added that list of radii it worked great, and then I put in a conversion so that my x y z coordinates show up correctly on the SimRender coordinates. So the hostcells now show up on the "floor" and parasites bounce around properly. Here's what it looks like now:
Yellow are host cells, red with green vectors are parasites. The green brackets are just selecting that cell.
There is only one problem. For some reason, the right hand wall is sticky. All the parasites hit it, or even end up outside it some how, and stick. Because of the way the world is set up, that wall is actually controlled by y-minimum in my code. So for some reason when a parasite's y-coordinate is less than or equal to 5 (y<= 5), the velocity turns to zero. This does not happen on any of the other walls. I checked the code and I can't find anything different about y-min...
very odd.