Follow simple algorithms involving fractions to draw pictures reminiscent of nature.
Scenery in films is often computer generated. Ever wondered how they do it? Next time you find yourself drawing doodles, draw an algorithmic doodle and explore algorithms for drawing nature. The algorithms are recursive: that is they describe one step and then tell you just to draw the next step in the same way, following the algorithm from the start.
- algorithmic thinking
- computational modelling
- algorithms in nature
- computer generated images
- computational thinking
Also for younger children practice and explore:
- maths: fractions
Here is an example Doodle Algorithm. What does it look like?
- Start by drawing a single straight vertical line
- DoodleDraw from that line as follows.
To DoodleDraw from a given line:
1. Draw 3 shorter lines at an angle in the top two-thirds of the line on its left side.
2. Draw 3 shorter lines at an angle in the top two-thirds of the line on its right side.
3. Choose a new existing line and DoodleDraw from that line
By following the algorithm you should get a picture something like this one: though as you choose the exact positions and lengths of lines randomly yours won’t be exactly the same just as no two plants are identical.
Different algorithms give different looking trees, grasses, ferns, snow flakes, crystals, …
… so now try the Doodle Algorithm on one of our sheets. Then start inventing your own doodle art algorithms and see how realistic the drawings you end up with are.
If you happen to have a computer handy you can then write programs to draw them too.
Resources: Doodle art algorithms
Here are Algorithmic Doodle Art sheets and solutions that you can download.
- Doodle Sheet: Algorithmic Doodle Art Sheet 1 – grass [pdf]
- Solution Sheet: Example Solution to Algorithmic Doodle Art 1 – grass [pdf]
- Doodle Sheet: Algorithmic Doodle Art Sheet 2 – grass [pdf]
- Solution Sheet:Example Solution to Algorithmic Doodle Art 2 – grass [pdf]
- Doodle Sheet: Algorithmic Doodle Art Sheet 3 – snowflake [pdf]
- Solution Sheet: Example Solution to Algorithmic Doodle Art 3 – snowflake [pdf]
- Doodle Sheet: Example Doodle Art Sheet 4 – christmas tree [pdf]
- Solution Sheet: Example Solution Doodle Art Sheet 4 – christmas tree [pdf]
- Doodle Sheet: Example Doodle Art Sheet 5 – recursive wrapping [pdf]
- Solution Sheet: Example Solution – Doodle Art Sheet 4 – recursive wrapping [pdf]
More to come …
Write Doodle art programs
Now try and code the rules up as a program in your favourite programming language using recursion (write a DoodleDraw function that calls itself). Your program should use randomness to draw a different version of the doodle each time it is run. You will also find you need to include a rule saying exactly when to stop. This is called the base case of the recursion. When drawing the pictures you probably just stopped when the picture looked detailed enough.
Write a program that creates a field of grass or sky full of snowflakes using the code.
Invent your own doodle art rules and write programs to draw using them.