trouble with moviemaker
in
Core Library Questions
•
1 year ago
So this should be an easy enough problem to solve but I am having trouble with a project I have been working on for some time. This bit of code is from a larger project but it is where I am getting hung up. I can tell the while loop is incrementing through my data-set as I would expect but I am not resulting in a video as I would expect. I end up with a video in which all the frames are empty even though places[g].draw exports a picture of the map I would expect.
I am new to processing and coding really so if there is any other information I should provide please let me know. I have been working on this project for a while and feel like I am close, I just need this last step.
Any help appreciated. Thanks to everyone who participates on this forum.
I am new to processing and coding really so if there is any other information I should provide please let me know. I have been working on this project for a while and feel like I am close, I just need this last step.
Any help appreciated. Thanks to everyone who participates on this forum.
- public void draw(){
int i = 1;
int d = 1;
int gap;
background(000);
image(mapImage, 0, 0); - //while i is smaller than the number of lines in my dataset
while (i < (numLines-2)){ - //gap is equal to the number of days between one record and the next
gap = Math.round(places[i].days) - Math.round(places[i-1].days); - //if the day placeholder changed from one record to the next than draw a dot for every lat long in dataset //from the beginning of the data-set to the current record and export as frame, repeat for the number of days //that elapsed from the last record (gap)
if (gap != 0) {
while (0 < gap) {
for (int g = 0; g < i; g++){
places[g].draw();
}
mm.addFrame();
System.out.println("gap izz " + gap + " days izz: " + Math.round(places[i].days) + " i izz: " + i);
gap--;
}
i++;
} else {
i++;
}
mm.finish();
noLoop();
}
}
1