CS 100
Assignment 2 |
Composition II
|
Using the Processing language/environment develop a program
that creates a composition containing repeated elements.
- Make a composition that includes several patterns and is visually pleasing.
- The composition may be either abstract or realistic.
You are encouraged to model your composition on an abstract painting, a poster, or a photograph. Simplify it, but not too much. If so, cite the work of art or image that inspired you at the back of your physical plan and in your source code header as a comment.
Plan and design your composition on paper: submit this plan during the lab on March 3rd. Your plan need not have the patterns completely drawn. The plan should indicate
- the locations of the beginning and end of each pattern
(draw only the first and last few iterations of a loop if it executes many times), - the graphical attributes used to create the repeated element,
- the effects produced by conditional statements and
- the effect of using random.
Your Processing program translates this plan to code.
Requirements
Your program obey the following constraints.- The image should be at least 500 pixels by 500 pixels. You may make your image bigger, but not smaller.
- The code should use
- at least three loop structures, either
for
orwhile
loops
- Often a loop changes only the location of a drawn shape at each iteration
but your loop should also change one more attribute at least once: the color or the size of the repeated shape for example, - One loop should include a conditional statement to change the control flow within it.
- One loop should have another loop nested inside it to create a dense pattern. (This counts only for one loop.)
- Often a loop changes only the location of a drawn shape at each iteration
- at least three types of shapes,
- at least three colours,
- at least one call to the
random
function to alter slightly the value of a variable and - well-named variables that define values used many times.
- at least three loop structures, either
- The geometry should be drawn with
smooth
edges. - The code should be indented and commented, including a header describing the program and giving author information, and for each loop, the shapes drawn, their changing properties and the values of variables altered.
sin
or cos
or transformation functions such as translate
, rotate
or scale
.
A random composition is not acceptable, the image created by your code
- should be controlled: the loops following a plan,
- should use the drawing primitives correctly and efficiently and
- should use suitable colors.
20% of the evaluation is based on the quality and control of the composition created by your code.
Submission
Create a zip file- named username_composition2.zip and
- containing your Processing folder abstractComposition with inside it
- the program composition2.pde and
- the resulting picture username_result2.png.
Use the function call
save("username_result2.png");
as the last line of your program
- If you did not bring your plan on March 3rd you have to include a
picture of it in your zip file.
If I do not see your plan by the assignment deadline the penalty is 10% of this work grade.
You should replace username with yours (mine is efourque).
Upload the zip file on Moodle using the Assignment 2 link and in the comment box you should respond to the following three questions.
- Are all the requirements completed? If no, list the missing ones.
- Did you do extra feature(s)? If yes, give short description(s).
- Are you giving me the permission to post your png picture on the course
gallery?
If yes, how do you want your name and the picture title to appear.
(Blanks --anonymous/untitled-- are possible choices.)