Step 1: Choose your motif
This photo was taken in Gansu province and the great sand dune is called MingSha mountain. In the image, the color of the dunes tones in the color of blue sky, which not only has an aesthetic quality but also has geometric features.
Step 2: Draw your image on paper
I first drew and simplified the image on graph paper. I used curve and bezier to draw the dunes and its shadow side. But I found it difficult to sketch the shape of cloud, so I added the moon and the sun instead of the cloud to decorate the sky.
Step 3: Draw your image with code & Step 4: Going beyond
I didn’t find the approach to make the color of sky change gradually, so I used several rectangles and filled in blue colors from dark to light. And I animate the positions of sun and moon to let them alternate.
float a=0;
float c=280;
float d=280;
float b=-800;
int mode=1;
void setup() {
size(800, 600);
}
void draw() {
// Your drawing code goes here
background(146,159,191);
fill(131,163,204);//sky
rect(0,0,800,150);
fill(161,178,208);
rect(0,150,800,300);
fill(183,197,223);
rect(0,300,800,450);
fill(174,188,215);
rect(0,450,800,600);
noStroke();
fill(90,75,68,200);//mountain1
beginShape();
vertex(-100,600);
bezierVertex(78,510,167,490,310,600);
endShape();
fill(158,103,73,150);//3
beginShape();
vertex(347,600);
bezierVertex(676,500,760,520,1000,600);
endShape();
fill(158,103,73);//mountain2
beginShape();
vertex(88,600);
bezierVertex(168,588,368,450,664,600);
endShape();
fill(90,75,68);//mountain2'
beginShape();
vertex(347,600);
bezierVertex(388,516,368,510,664,600);
endShape();
fill(#FFFA6A,170);
ellipse(a,c,100,100);
a=a+4;
if(a>=0&&a<=400){
c=c-1;
}
if(a>=400){
c=c+1;
}
if(a==800) {a=-800;c=280;}
b=b+4;
if(b<=400&&b>=0){
d=d-1;
}
if(b>=400){
d=d+1;
}
if(b==800) {b=-800;d=280;}
fill(#FF6040,170);
ellipse(b,d,100,100);
println(mouseX,mouseY);
}
I think drawing in Processing is interesting because it can realize the combination of images and movements. And maybe I can depict a short story with Processing, it is a good means of realizing design.