FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Topics & Contributions
   Responsive Form, Games
(Moderator: REAS)
   4 new toys
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: 4 new toys  (Read 619 times)
seb

WWW
4 new toys
« on: Sep 18th, 2003, 9:44pm »

I have posted a few new processing toys:
 
A cellular automaton in 3D space:
http://www.seb.cc/processing/CA_3D_1/index.html
 
A system of forces based on triplets instead of pairs
http://www.seb.cc/processing/TRIPLETS/index.html
 
Interactive sine-pattern maker
http://www.seb.cc/processing/SIN_PATTERN_SLIDERS/index.html
 
Yet another metaball (po'boy motion blur).
http://www.seb.cc/processing/MBALL_03/index.html
 
Enjoy!
Seb--
 
vent

WWW
Re: 4 new toys
« Reply #1 on: Sep 18th, 2003, 11:28pm »

Great work! I can't wait to see more. SIN_PATTERN_SLIDERS brings me back to the days of kpt 1.0.  
 
I made this thing awhile back (has a similiar intention):  
 
http://www.shapevent.com/proc/tex/
 

http://www.shapevent.com/
mKoser

WWW Email
Re: 4 new toys
« Reply #2 on: Sep 19th, 2003, 1:20am »

indeed, very nice work
 
Regarding the TRIPLETS!
i just spent a few minutes playing with your code... my initial idea was to change the color of the stroke (yellow would be nice!) but for some reason the blur() method only blurs in grey-tones?... would you care to explain why this is? (or would it be possible with a minor hack to make it blur RGB colors?)
 
GREAT!
Mikkel
« Last Edit: Sep 19th, 2003, 1:21am by mKoser »  

mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
seb

WWW
Re: 4 new toys
« Reply #3 on: Sep 19th, 2003, 3:39am »

Yes the blur code only reads the blue value of the pixels, computes the new intensity, and repacks the same value on R,G and B. It saves a few calculations.
 
You can modify the blur() routine as follow (it will be noticably slower):
 
Code:

void blur() {
  int index,R,G,B,left,right,top,bottom;
 
  for(int j=0;j<WIDTH;j++) {
    for(int i=0;i<HEIGHT;i++) {
      index=i*WIDTH+j;
 
      // Wraparound offsets
      if(j>0) left=-1; else left=WIDTH-1;
      if(j==(WIDTH-1)) right=-WIDTH+1; else right=1;
      if(i>0) top=-WIDTH; else top=(HEIGHT-1)*WIDTH;
      if(i==(HEIGHT-1)) bottom=-(HEIGHT-1)*WIDTH; else bottom=WIDTH;
 
      // Calculate the sum of n neighbors
      R=(pixels[left+index]>>16) & 255; // left middle
      R+=(pixels[right+index]>>16) & 255; // right middle
      R+=(pixels[index]>>16) & 255; // middle middle
      R+=(pixels[index+top]>>16) & 255; // middle top
      R+=(pixels[index+bottom]>>16) & 255; // middle bottom
      R=(R/5);
 
      G=(pixels[left+index]>>8) & 255; // left middle
      G+=(pixels[right+index]>>8) & 255; // right middle
      G+=(pixels[index]>>8) & 255; // middle middle
      G+=(pixels[index+top]>>8) & 255; // middle top
      G+=(pixels[index+bottom]>>8) & 255; // middle bottom
      G=(G/5);
 
      B=pixels[left+index] & 255; // left middle
      B+=pixels[right+index] & 255; // right middle
      B+=(pixels[index] & 255); // middle middle
      B+=pixels[index+top] & 255; // middle top
      B+=pixels[index+bottom] & 255; // middle bottom
      B=(B/5);
      pixels[index]=(R<<16)+(G<<8)+B;
    }
  }
 
}
« Last Edit: Sep 19th, 2003, 3:44am by seb »  
elout

12747371274737 WWW
Re: 4 new toys
« Reply #4 on: Sep 19th, 2003, 3:20pm »

nice work seb.
 
btw. how did you find out about the lightning/lamps?
 
seb

WWW
Re: 4 new toys
« Reply #5 on: Sep 19th, 2003, 5:19pm »

Thanks all!
 
Lights HOWTO:
http://proce55ing.net/discourse/yabb/board_Syntax_action_displa_y_num_1057115468.html
 
elout

12747371274737 WWW
Re: 4 new toys
« Reply #6 on: Sep 19th, 2003, 5:55pm »

thx seb, I started to play with a little lightning today, although you have to click in the screen first to get different coloured lights floating around;
 
http://www.xs4all.nl/~elout/proce55ing/loise/
 
mKoser

WWW Email
Re: 4 new toys
« Reply #7 on: Sep 19th, 2003, 10:23pm »

Quote:
You can modify the blur() routine as follow (it will be noticably slower)

 
thanks seb...
 

mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
Pages: 1 

« Previous topic | Next topic »