Draw a House Challenge
THIS CHALLENGE COMES FROM PROCESSING CREATIVE CODING AND GENERATIVE ART IN PROCESSING 2 BY IRA GREENBERG, DIANNA XU, AND DEEPAK KUMAR.
Try to draw this house using this initial command to set the size of the sketch window:
createCanvas (400, 600);
Remember that the first number is the length of the box (x axis) and the second number is the height (y axis).
Follow this first command by as many of these commands as you need to complete the task:
rect ( x, y, length, height );
triangle ( x1, y1, x2, y2, x3, y3 );
ellipse ( x, y, width, height );
Also put a comment before each command to describe what the next command does. For example:
//set the size of the window
createCanvas (400, 600);
It will take many tries to get it right, and trying things over and over again and improving it as you go is a big part of the engineering process.
Extra: Add a Chimney!
Below is the file we used in class.
Try to draw this house using this initial command to set the size of the sketch window:
createCanvas (400, 600);
Remember that the first number is the length of the box (x axis) and the second number is the height (y axis).
Follow this first command by as many of these commands as you need to complete the task:
rect ( x, y, length, height );
triangle ( x1, y1, x2, y2, x3, y3 );
ellipse ( x, y, width, height );
Also put a comment before each command to describe what the next command does. For example:
//set the size of the window
createCanvas (400, 600);
It will take many tries to get it right, and trying things over and over again and improving it as you go is a big part of the engineering process.
Extra: Add a Chimney!
Below is the file we used in class.