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.
IndexDiscussionExhibition › colorGrid2
Page Index Toggle Pages: 1
colorGrid2 (Read 1235 times)
colorGrid2
Dec 26th, 2008, 7:27pm
 
Hey all.

I first built this interactive art piece in Mobile Processing to have some fun with my Nokia 3500, then brought it over to Processing to share on the web.

It doesn't manipulate live video or anything fancy but it was an experiment to see how long it would take to get a basic animation idea onto my cell phone.

See the Processing applet here: http://www.littlebig.ca/colorgrid2/

And if you would like, try the .jar I created with mobile processing on your Java-enabled cellphone: http://www.littlebig.ca/colorgrid2.jar

Cheers, and happy holidays and new year.

Gary
Re: colorGrid2
Reply #1 - Jan 8th, 2009, 1:25pm
 
I like this a lot. It's nice to see more clean looking sketches.

It'd be cool if new squares bordering on others of the same color automatically erase the borders between each other. Not sure how you'd go about doing this efficiently.
Re: colorGrid2
Reply #2 - Jan 8th, 2009, 5:33pm
 
Thanks aceface,

I thought about that-- the lines bordering dissapearing-- and may try to add it as a variation later.

I actually did that to great effect (increased playability) in my 1996 Java applet game, "Cabeem" (basically, same-game) -- http://www.aurete.com/cabeem/

Cheers, and thanks for your feedback,

Gary
Re: colorGrid2
Reply #3 - Jan 12th, 2009, 12:47am
 
I was wondering if the source for the mobile version was available.

I really am interested in colorgrid2 . REAL GOOD!

I posted in the mobile area
http://mobile.processing.org/discourse/YaBB.cgi?board=programs;action=display;num=1231716899;start=0#0

--

I am trying to make things for my phone .


--also also --
happy new year to you & yours
it is a blackberry perl 8130....
so i am presently working through some tutorials.

also also - i went to the cabeen webgame -- that is interesting also. ....the texture within the clusters -- gee whiz!
Re: colorGrid2
Reply #4 - Jan 12th, 2009, 4:48pm
 
I don't have the source on me at the moment being away from my home computer, but I'll be able to post the source for the mobile version later... um... also the random function in mobile returns in integer but in normal processing returns a float so I had to change the code. Also in mobile processing the random function returns a random digit up to the number passed but in normal processing it returns up to but not in including the number so to translate to the mobile you'd need to decrease the number passed by 1.  e.g. random(4) not random(5).

Anyhow I'll just send the different mobile source later this week and you can compare.

Cheers,

Gary
Re: colorGrid2
Reply #5 - Jan 12th, 2009, 8:24pm
 
Wow thanks -- that would be huge...
in fact it is this matter of no floating point and the use of all that fixed point val stuff ( amazing  ) itofp & fptoi

Re: colorGrid2
Reply #6 - Jan 13th, 2009, 5:19am
 
Here is the mobile processing version:



Quote:


import processing.phone.*;

Phone p;

int x, y, blockWidth, blockHeight, gridWidth, gridHeight;
int[] colorRange=new int[6];
int modWidth, modHeight;
int power;
int gridStartWidth, gridStartHeight;
int i=0;
boolean paused, randomSize;

void calcBlockWidth() {

 blockWidth=(width-modWidth)/gridWidth;
 blockHeight=(height-modHeight)/gridHeight;
}

void setup() {
 p=new Phone(this);
 p.fullscreen();
 background(0);
 int[] theColorRange={255,0,255,0,255,0};
     colorRange=theColorRange;
 modWidth=width%64; //make sure width of draw area divisible by 64
 modHeight=height%80;  //make sure height of draw area divisible by 80
 gridWidth=gridStartWidth=4;
 gridHeight=gridStartHeight=5;
 calcBlockWidth();
 randomSize=true;
}

void draw() {
 if(paused==false) {
   if (randomSize) {
     if (random(100)==7) {
       power=pow(2,random(3)+1);
       gridWidth=gridStartWidth*power;
       gridHeight=gridStartHeight*power;
       calcBlockWidth();
     }
   }
   fill(random(colorRange[0])+colorRange[1],random(colorRange[2])+colorRange[3],random(colorRange[4])+colorRange[5]);
   x=random(gridWidth-1);
   y=random(gridHeight-1);
   rect (x*blockWidth+(modWidth/2),y*blockHeight+(modHeight/2),blockWidth,blockHeight);
 }
}

void keyPressed() {
 switch (keyCode) {
 case LEFT:
   paused=false;
   gridWidth=max(gridStartWidth,gridWidth/2);
   gridHeight=max(gridStartHeight,gridHeight/2);
   calcBlockWidth();
   break;
 case RIGHT:
   paused=false;
   gridWidth=min(gridWidth*2,gridStartWidth*16);
   gridHeight=min(gridHeight*2,gridStartHeight*16);
   calcBlockWidth();
   break;
 case UP:
   paused=false;
   background(0);
   break;
 case DOWN:
   paused=!paused;
   break;
 case FIRE:
   randomSize=!randomSize;
   break;
 }

 switch (key) {
 case '1':
   int[] the1ColorRange={60,180,60,20,60,20};
   colorRange=the1ColorRange;
   background(0);
   break;
     case '2':
   int[] the2ColorRange={60,180,60,180,80,20};
   colorRange=the2ColorRange;
       background(0);
   break;
    case '3':
   int[] the3ColorRange={80,20,80,20,60,180};
   colorRange=the3ColorRange;
       background(0);
   break;
    case '4':
   int[] the4ColorRange={255,0,255,0,255,0};
   colorRange=the4ColorRange;
       background(0);
   break;
 
 }

}


Page Index Toggle Pages: 1