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
Fire routine? (Read 533 times)
Fire routine?
May 2nd, 2007, 1:51am
 
So I am trying to do a fire routine an I need to have a separate array for the last frame from pixels[].  I will call it lastframe[].  But I do not need to use pixels[] to read data.  Is it possible to:

pixels[] = lastframe[];
updatePixels();

???  Or do I HAVE to call loadPixels() first?  It just seems like a waste since I am not going to be using pixels for anything but writing.
Re: Fire routine?
Reply #1 - May 2nd, 2007, 2:58am
 
ok I figured out my problem.  but I need this to work:

color lastframe[((height - 1) * width) + width][2];

color IS a data type RIGHT???
Re: Fire routine?
Reply #2 - May 2nd, 2007, 11:16am
 
What do you think that does? Are you trying to create a new 2d array for the last 2 frames or something?

if so you probably want:
color[][] lastframe=new color[2][width*height];

then you can just (I think) do something along the lines of:
loadPixels();
lastframe[1]=lastframe[0];
lastframe[0]=pixels;
Page Index Toggle Pages: 1