• fullscreen
  • vortex.pde
  • //Vortex//Alejandro González//60rpm.tv/i//Pubic Domain/////////////////////////////////////////
    //Just playing with some particles and convolution (the latter based on dotlassie´s fast blur// 
    //algorithm (credits below)////////////////////////////////////////////////////////////////////
    int h=450,w=900,s=w-1,M=-1;  //some constant values here
    P[] p = new P[1000];         //1000 particles
    LinkedList<PVector> a;       //x attractors
    void setup(){
      size(w,h,P2D); background(0); stroke(M);
      for(int i=0;i<p.length;i++) p[i]=new P();
      a= new LinkedList<PVector>();
    void draw(){
      for(int i=0;i<p.length;i++) {p[i].update(a); p[i].display();}
    ////////////////////////////////////////////////////////////////Some basic interaction here
    //Click to add attractors
    void mousePressed(){a.add(new PVector(mouseX,mouseY));}  
    void keyPressed(){setup();}
    //Particle class with motion provoked by attractors connected with some magnetism to the particles
    //Particles wanders around the 'gravity center' of the poles. That will be our vortex.
    class P {
      float d,k,m,h; PVector l,s,a;
        l= new PVector(random(width),random(height)); //random location
        a=new PVector(); s=new PVector();             //acceleration, speed
        m=.01;                                        //magnetic force
      //Some magnetic attraction -- inverse to distance, proportional to the magnetic force 
      void update (LinkedList<PVector> A){
        if (A!=null){
          for(PVector v:A) 
      void display(){
    //Studying Dotlassie's fast blur //http://www.openprocessing.org/visuals/?visualID=5383,/////////////////////
    //I realized more than a blur effect it's some kind of clever convolution generic tool with a constant mask//
    //value, as useful to make a blur as to get different effects////////////////////////////////////////////////
    //Thus experimenting I came into this sketch... ^-^////////////////////////////////////////////////////////
    void convolutionMask(int m){ 
      int[] p=pixels;
      for(int y=1;y<h-1;y++){ 
        int yw1=y*w+1, yws=y*w+s;
        for(int i=yw1;i<yws;i++) {
          //Apply AND to a reduced convolution kernel of four pixels(+) and get the average value (>>2=/4)


    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.



    Report Sketch

    Report for inappropriate content

    Please provide details if possible:

    Your have successfully reported the sketch. Thank you very much for helping to keep OpenProcessing clean and tidy :)

    Make a Copyright Infringement claim

    ale plus+


    Add to Faves Me Likey@! 24
    You must login/register to add this sketch to your favorites.

    Just messing around with some particles guided by attractors and convolution. The latter one is based on dotlassie´s fast blur:
    Click to create an attractor (they´ll define the shape of the vortex).
    Press any key to reset.

    Eduardo Obieta
    22 Mar 2012
    wow Ö
    that looks real awesome
    ale plus+
    7 Jul 2012
    Nathan Riggs
    3 Sep 2012
    I can't help but notice how similar the results are (visually) to something I've done, though it looks like we've approached it in very different ways. Strange.

    ale plus+
    23 Sep 2012
    Hi Nathan, may be it's not so strange. We both have used a 'visual encoding' based on convolution algorithms and these ones tend to create that complex fancy patterns.
    Btw, nice sketch. I love the zoom, well thought. It's quite interesting to check that pixel bunches magnificated.
    Fabian Paul
    31 May 2014
    Reminds me a bit of Simon Tatham's "filigrams". He has some mathematical explanations. http://www.chiark.greenend.org.uk/~sgtatham/filigram/
    ale plus+
    1 Jun 2014
    Thanks for the reference, very interesting paper!
    You need to login/register to comment.