We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Stop-Motion Animation.. (Read 1343 times)
Stop-Motion Animation..
Oct 10th, 2007, 1:56am
 
Hi everyone.
I am interested in making stop-motion animation loops using processing but I am having some issues.  Right now, I have a set of 7 images, and I am loading each images in an Pimage array and displaying it on screen frame by frame.  The animation goes on for a little bit and it spits a "java.lang.OutOfMemoryError".  Is there a better way to create the loop to avoid this problem?

here's the code:

int numFrames = 7;
int frame = 0;
PImage[] images = new PImage[numFrames]; //image array

void setup(){
 size(800, 800);
 frameRate(6);
 images[0] = loadImage("1.jpg");
 images[1] = loadImage("2.jpg");
 images[2] = loadImage("3.jpg");
 images[3] = loadImage("4.jpg");
 images[4] = loadImage("5.jpg");
 images[5] = loadImage("6.jpg");
 images[6] = loadImage("7.jpg");
}

void draw(){
 frame++;
 if(frame == numFrames){
   frame = 0;
 }
 image(images[frame], 0, 0, 800, 800);
}
Re: Stop-Motion Animation..
Reply #1 - Oct 10th, 2007, 2:30pm
 
http://processing.org/reference/troubleshooting/#memory

does it get through the image sequence more than once?
Re: Stop-Motion Animation..
Reply #2 - Oct 15th, 2007, 6:19am
 
Thanks that FAQ made it work!
Page Index Toggle Pages: 1