見出し画像

とりあえず100 # 6

float n_Rot = 300;//カーブの周期数
float startCol = random(100);//カーブの最初の色
float endCol = random(100);//カーブの最後の色

void setup(){
size(1000, 800);
blendMode(SCREEN);
colorMode(HSB, 100, 100, 100, 100);
background(#000A08);
noStroke();

//DRAW LIGHT AND REFLECTION
pushMatrix();
translate(width/2, 0);

for(float ang = 0; ang <= TWO_PI * n_Rot; ang += .01){
  
float rad = sin(map(ang, 0, TWO_PI * n_Rot, 0, TWO_PI*20)) * width/20;
float x = tan(ang) * rad + tan(ang/2) * rad;
float y = map(ang, 0, TWO_PI * n_Rot, 0, height) + sin(ang/n_Rot) * 100;

float esize =  0.2 + (sin(map(ang, 0, TWO_PI * n_Rot, 0, PI))*2);
fill(map(ang, 0, TWO_PI * n_Rot, startCol, endCol), 80, 60);
ellipse(x, y, esize*20, esize/10);
}
popMatrix();

//DRAW SKY
blendMode(NORMAL);
 for(int y = 0; y <= height/2; y ++){
   float H = map(y, 0, height/2, startCol, endCol);
   float S = map(y, 0, height/2, 80, 40);
   float B = map(y, 0, height/2, 60, 90);
   float A =  -60 + sin(map(y, 0, height/2, 0, PI/2)) * 150;
  stroke(H, S, B, A);
  strokeWeight(1);
  line(0, y, width, y);
}
}

//DRAW LIGHT AND REFLECTION部分だけだとこんな感じ。

//DRAW SKY部分だけだとこんな感じ。

タンジェントカーブに空っぽいものを半透明で上書きすることで、海っぽくみえます。

夏なので海を作ろうと思い作りましたが、夏っぽさ0ですね。

でも幻想的な雰囲気になったので満足です。



この記事が気に入ったらサポートをしてみませんか?