239
edits
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=for Computers= | =for Computers= | ||
==I: Kasimir Malewitsch's bird== | ==I: Kasimir Malewitsch's bird== | ||
''Originally based on the task to recreate a piece of Kasimir Malewitsch, I accidentally arranged forms more in a way a bird looks like and decided to continue that approach instead.'' | |||
{| border="1" | {| border="1" | ||
|- | |- | ||
Line 90: | Line 92: | ||
==II: Cute Bauhaus== | ==II: Cute Bauhaus== | ||
''Here recreation was also the topic, refined with some first simple interaction.'' | |||
{| border="1" | {| border="1" | ||
|- | |- | ||
Line 149: | Line 152: | ||
|} | |} | ||
==III: Cat Eyes== | ==III: Cat's Eyes== | ||
''My first nested for loops sketch with some slight random function adventures that resulted in unexpected "eye like" circles, maybe cat's eyes. I would like to use those eyes in a future sketch!'' | |||
{| border="1" | {| border="1" | ||
|- | |- | ||
Line 157: | Line 161: | ||
|[[File:katzenaugen (Konvertiert)-quicktime.mov|500px]] | |[[File:katzenaugen (Konvertiert)-quicktime.mov|500px]] | ||
|<source lang=java> | |<source lang=java> | ||
int gap=100; | |||
void setup(){ | void setup(){ | ||
Line 182: | Line 186: | ||
fill(R,G,B); | fill(R,G,B); | ||
ellipse(xPos,yPos,ellWidth,ellHeight); | ellipse(xPos,yPos,ellWidth,ellHeight); | ||
} | |||
} | |||
} | |||
</source> | </source> | ||
|- | |- | ||
Line 187: | Line 194: | ||
==IV: Butterflies== | ==IV: Butterflies== | ||
''Again in this sketch I benefited from unexpected "errors" while trying to get more into arrays and their use. Originally I just wanted to create different rectangular forms that are kept in the frame like fish in an aquarium and step back when they reach the boarder. But what i actually got was some pixelated flickering things, that, I guess could be seen in an abstract pixel art universe as butterflies. Obviously I still don't understand arrays and there consequences for following code lines fully, but I like the result and kept it.'' | |||
{| border="1" | {| border="1" | ||
|- | |- | ||
Line 195: | Line 202: | ||
|[[File:butterflies (Konvertiert)-quicktime.mov]] | |[[File:butterflies (Konvertiert)-quicktime.mov]] | ||
|<source lang=java> | |<source lang=java> | ||
int num= | int num=50; //number of butterflies, but actually around 5 "form" one... | ||
int stepLength=10; //tempo of them | int stepLength=10; //tempo of them | ||
Line 205: | Line 212: | ||
void setup() { | void setup() { | ||
rectMode(CENTER); | rectMode(CENTER); | ||
size( | size(1280,720); | ||
background(255); | background(255); | ||
noStroke(); | noStroke(); | ||
for(int i=0; i<x.length; i++){ | for(int i=0; i<x.length; i++){ | ||
x[i]=(int)random(width); | x[i]=(int)random(width); // random position of the butterflies | ||
y[i]=(int)random(height); | y[i]=(int)random(height); | ||
w[i]=(int)random(20,80); | w[i]=(int)random(20,80); | ||
Line 223: | Line 230: | ||
for(int i=0; i<x.length-1; i++){ | for(int i=0; i<x.length-1; i++){ | ||
int newX=x[i]+=random(-stepLength,stepLength); | int newX=x[i]+=random(-stepLength,stepLength); //move the butterflies | ||
int newY=y[i]+=random(-stepLength,stepLength); | int newY=y[i]+=random(-stepLength,stepLength); | ||
if(newX<0) newX = width; | if(newX<0) newX = width; | ||
else if(newX>width) newX = 0; | else if(newX>width) newX = 0; | ||
if(newY<0) newY = height; | if(newY<0) newY = height; //keep them | ||
else if(newY>height) newY = height; | else if(newY>height) newY = height; | ||
x = append(x, newX); | x = append(x, newX); | ||
y = append(y, newY); | y = append(y, newY); // I guess this results in "butterfly effect" | ||
if(x.length > num){ | if(x.length > num){ | ||
Line 240: | Line 247: | ||
rect(x[i],y[i],w[i],h[i]); | rect(x[i],y[i],w[i],h[i]); | ||
} | } | ||
fill(x[i],y[i],150); | fill(x[i],y[i],150); //mellow colours | ||
} | } | ||
} | } |
edits