NEORTで作品を公開してみた。

NEORTでProcessing作品を公開してみました。

見ていただけると嬉しいよ。

neort.io

ソースコードは以下。flow関数がベクトル場の表現である。

  int windowWidth=900;
  int windowHeight=900;
 final color palette[]={#70d6ff, #ff70a6, #ff9770, #ffd670, #e9ff70};//#d4e4bc, #96acb7, #36558f, #40376e, #48233c};
 final int numColor=palette.length;
void setup() { 
  surface.setResizable(true);
  surface.setSize(windowWidth, windowHeight);
  background(255);
  noLoop();
  surface.setResizable(false);
}

void draw(){
 translate(width/2,height/2);
 background(255);
 strokeWeight(1);
 for(int i=-width/2;i<width/2+20;i+=20){
   for(int j=-height/2;j<height/2+20;j+=20){
     float r=sqrt(((float)i)*((float)i)+((float)j)*((float)j));
     stroke(palette[0]);
     //if(r>0&&r<height/float(numColor)){stroke(palette[0]);}
     //if(r>height/float(numColor)&&r<2*height/float(numColor)){stroke(palette[1]);}
     //if(r>2*height/float(numColor)&&r<3*height/float(numColor)){stroke(palette[2]);}
     //if(r>3*height/float(numColor)&&r<4*height/float(numColor)){stroke(palette[3]);}
     //if(r>4*height/float(numColor)&&r<5*height/float(numColor)){stroke(palette[4]);}
     PVector v;
     v=flow(i,j);
     line(i,j,i+v.x,j+v.y);
   }
 }
 
}

PVector flow(float _x,float _y){
  PVector v=new PVector(0,0);
  float r=sqrt(((float)_x)*((float)_x)+((float)_y)*((float)_y));
  //v.x=-0.3*_y;
  //v.y=0.3*_x;
  
  //v.x=_x-_y-0.1*r;
  //v.y=_y-_x-0.1*r;
  
  v.x=(2*_x-_y)/10;
  v.y=(2*_y-_x)/10;
  
  return v;
}