Tunnel effect in processing using copy

Nikolaus Gradwohl2009-05-09T07:48:00+00:00

i worte a little tunnel effect using the copy command and a transparent rectangle in processing. i use no perlin noise in this sketch, just a plain random and copy command that scales the image and a transparent rect, to make the older pixel fade out. (don't ask me why it has to be 19 pixel less then width, but when i use 20 it gets dragged to the lower right corner)

copy(10, 10, width-19, height-19,0,0,width, height ); 
fill(0,10);
rect(0,0,width, height );

click here to see it in action

tunnle effect

code:

/**
* a tunnle effect by <a href="https://www.local-guru.net/blog">Guru</a>
*/
void setup() {
  size(300,300);
  frameRate(25);
}

void draw() {
  noStroke();
  copy(10, 10, width-19, height-19,0,0,width, height ); 
  fill(0,10);
  rect(0,0,width, height );
  pushMatrix();
  translate( width/2, height/2 );
  stroke(255);
  strokeWeight(2);
  for( int i = 0; i < 360; i++ ) {
    stroke( 255, random(255), 0); 
    point( cos(radians(i)) * 7, sin(radians(i)) * 7 );
    point( cos(radians(i)) * 8, sin(radians(i)) * 8 );
  }
  popMatrix();
}
Tweet This! submit to reddit Digg! Tags: | 1 comments | no trackbacks

See also:

sketch experiment 7 - osc events
nested cubes in processing
processing phaseflower
Time Perception
de jong attractor

Trackbacks

Comments

Leave a response

  1. murase_syuka 2009-06-02T14:32:31+00:00

    don't ask me why it has to be 19 pixel less then width because range is 0..299 therefore width/2 height/2 is not center.

    <<< copy(10,10,width-20,height-20,0,0,width-1,height-1); translate((width-1)/2,(height-1)/2);

Leave a comment