Loading...
Logo
Processing Forum
Hello!

I want to realize a effect similar to the vector effect in Illustrator called roughen. 
I've made a screenshot to make clear what i mean:



I want this effect to be dynamic, that the result is a growing/shrinking/pulsing ellipse with distorted outlines. Like a smooth animation of the 5 steps that are shown in the picture. I would be great to get some thoughts how to solve this problem!

Best,
Herbert

Replies(8)

This is very similar to one of the programs included in the Generative Gestaltung book.

Just think of a circle that consists of a lot of independent moving particles.
You can take a look at the source here :
http://www.generative-gestaltung.de/P_2_2_3_01

I made some code to draw irregular circles (using line segments): first shown in causing pixels to fall and then (refined) in PNG from screen with transparent background (both on old forum).
Perhaps you can use that as a base/source for ideas.
Thanks for the fast replies. Both suggestions helped me alot!
Something like that ?
 
Copy code
  1. PVector[]  tabPoint;
  2. int        nbPoint = 50;
  3. int        rayon   = 100;
  4. void setup() {
  5.   size(300,300);
  6.   tabPoint = new PVector[nbPoint];
  7.   float angle = TWO_PI/(nbPoint);
  8.   for(int division=0;division<nbPoint;division++)
  9.   {
  10.     tabPoint[division] = new PVector(rayon*cos(angle*division),
  11.                                      rayon*sin(angle*division));
  12.   }
  13.   smooth();
  14. }
  15. void draw()
  16. {
  17.   PVector move = new PVector();
  18.   background(255);
  19.   noFill();
  20.   stroke(0);
  21.   strokeWeight(5);
  22.   translate(width/2,height/2);
  23.   beginShape();
  24.   curveVertex(tabPoint[0].x,tabPoint[0].y);
  25.   for(int division=0;division<nbPoint;division++)
  26.   {
  27.     curveVertex(tabPoint[division].x,tabPoint[division].y);
  28.   } 
  29.   curveVertex(tabPoint[0].x,tabPoint[0].y);
  30.   curveVertex(tabPoint[1].x,tabPoint[1].y);
  31.   endShape(); 
  32.   //--- Animation
  33.   for(int division=0;division<nbPoint;division++)
  34.   {
  35.     move.x = tabPoint[division].x;
  36.     move.y = tabPoint[division].y;
  37.     move.normalize();
  38.     move.mult(random(-1,1));
  39.     tabPoint[division].x += move.x;
  40.     tabPoint[division].y += move.y;
  41.   } 
  42. }
You can also use the Bezier representation of a circle, which can be done with any number of points. By scaling the distances of the points and changing the control points, you can control the "roughness" of the circle. Here's an example with an evenly divided circle: http://ignotus.com/factory/2010/03/bezier-circle/. You can place the points at irregular intervals, too, you'll just need to calculate the distances from Bezier point (on curve) to control points (off curve) in ratio to the sectors of the circle swept out between Bezier points. You could also start with a regular Bezier representation of a circle or ellipse, use Processing bezierPoint() function to interpolate new points and then displace them outwords or inwards, scale and rotate control points, etc.

Lots of good ways to do this.
I wrote a little processing sketch starring a monster using curve vertex to get a very similar effect 

http://www.local-guru.net/blog/2008/11/18/porcessing-monster

this is the code i'm using to generate the monster. When the mouse button is clicked, 
the vertices are moved by some random factor. 

I love em, Procesing Monsters is a really nice collection :)
for those who doesnt know it yet http://www.rmx.cz/monsters/

Amusing and well done! :-)
Do you plan to add it to the other Processing monsters?