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.
IndexProgramming Questions & HelpOther Libraries › pixels Array and MPE
Page Index Toggle Pages: 1
pixels Array and MPE (Read 372 times)
pixels Array and MPE
Jun 17th, 2008, 2:08pm
 
Hi folks

I try to turn a normal sketch into a MPE (most pixels ever library) compatible one. The display get filled by horizontal color stripes of 10pix height. When the stripes reache the bottom of the display the whole image should shift up to make space for a new stripe (and so on). To shift up the whole image i manipulate the pixels Array of the display (see code below).

In a normal sketch this works great, but by using the MPE framework the animation freezes when executing this part of the code. Is it basicaly possible to manipulate the pixels array in a MPE sketch, or do I have to broadcast the hole display from client one to the other clients? And, is a array of the whole screen not to big to be broatcasted over the network? I use 3 screens on a resolution of 1024x768 pixels.

the code in the MPE file:
Code:

if(yTxt > client.getM()){
loadPixels();
for(int i = 0; i < client.getMWidth()*client.getMHeight(); i++){
if(i < (client.getMWidth()*client.getMHeight())-(10*client.getMWidth())){
pixels[i] = pixels[i+(client.getMWidth()*10)];
}
else{
colorMode(RGB, 255);
pixels[i] = color(255);
}
}
updatePixels();
yTxt -= 10;
}

the code in the normal file:
Code:

if(yTxt > height){
loadPixels();
for(int i = 0; i < width*height; i++){
if(i < (width*height)-(10*width)){
pixels[i] = pixels[i+(width*10)];
}
else{
colorMode(RGB, 255);
pixels[i] = color(255);
}
}
updatePixels();
yTxt -= 10;
}


I already tried to put the whole array into an array of a PImage on client one, to broatcast this picture afterward and place it in the other clients, but it didn't work. If somebody could explain to me how broadcasting works exactly, it would be grate. Or, if somone knows an other solution to shift up the hole display by 10pix and insert a white space, I would be glad to learn it Wink

I hope this was understandable, if you have any additional questions, just ask.

thanks in advance Thomas
Page Index Toggle Pages: 1