Picking up from where I left off last week, currently trying to work out which part of the class structure actually tells the birds to update their positions. From looking at the simulation code, the important piece is either in the Boid or FlockBehavior class. However, I can see that an importnat piece of printing boid positions is getting the position vector into some other form, which I think will be the first port of call: how to print a vector to a text file. Note that it’s a vector3f type.
Okay: in the Boid class, I’ve added 3 extra methods: getBoidX, getBoidY and getBoidZ (look at lines 286), which all return the specific variable of interest, of the x, y, z positions. Now, in the FlockBehavior class there is a method called processStimulation (line 72-ish). This method now calls each of the methods I’ve added, and prints them to screen. The next issue, needless to say, is: how to print this to a text file?
Right — no idea, in short! Look at what you’ve done on line 78 -> 93, and go from there.