Flowers

Back to Codes of Nature


Author: Zsófia Ruttkay Version: 1.0 Date: 25.2.2009

Flowers

Series of flower sketches, illustrate usage of simple shapes (for petals), array and for loop to draw them, rotation, translation and scale.
Some with mouse control and gradient color usage. r is a version with randomness for shape and location of petals
a is a version with drawing order animated
g is a version with growth animated
m is a version with mouse control

../Sketches/CourseSketches/Flowers/Flower1/Flower1.jpg Flower1 Flower1g
Single set of identical ellipsoid petals around an (optional) center.
Size and color of petals and center are given by variables.
Petals are drawn in a loop, according to numerical and logical parameters.
noFill(), noStroke(), smooth()
ellipse(), translate(), rotate()
for(), if()
../Sketches/CourseSketches/Flowers/Flower2/Flower2.jpg Flower2
Mod of Flower1: Double set of petals around an (optional) center.
Given pars generate Golgotavirag (Passiflora).
Parameters are in an arrays of length 2, for the parameters of the 2 set of petals.
int[], float[], boolean[]
../Sketches/CourseSketches/Flowers/Flower3/Flower3.jpg Flower3 Flower3g
Mod of Flower1: Set of identical petals in a bunch, not in full circle.
New variable defines starting angle.
arc()
../Sketches/CourseSketches/Flowers/Flower3m/Flower3m.jpg Flower3m
Mod of Flower3: On mousePressed flowers are drawn, for c key cleared.
Angle is random, size is controlled by mouse y position.
random(), keyPressed(), redraw(), mouseX, mouseY,
../Sketches/CourseSketches/Flowers/Flower4/Flower4.jpg Flower4
Mod of Flower2: The 2 circles may have rotated with respect to each other, and may be of different petal forms: stroke, ellipse, or special polygons.
Petals may have gradient color, which is realised by drawing different sizes of the petal shape on each other, in each case different color.
switch(),
function with parameter
../Sketches/CourseSketches/Flowers/Flower5/Flower5.jpg Flower5 Flower5a Flower5g
Petals arranged in a spiral.
Mod of Flower1: Flower with spirally placed and sized circle petals. The spiral is the Archimedes spiral, the form of which depends on the initial rotAlpha.
Petals may have changing color depending on distance from center.

../Sketches/CourseSketches/Flowers/Flower6/Flower6.jpg Flower6
Mod of Flower1: Single set of identical petals of smooth, specifically designed shaped and some with texture-like curved lines, and (optional) center.
The form of the petal is given by drawPetal1(), drawPetal2(),.... In draw one of the different functions is called. On mousePressed a new shape is used.
curveVertex(), beginShape(), endShape()
../Sketches/CourseSketches/Flowers/Flower1r1/Flower1r1.jpg Flower1r1
Mod of Flower1: Petals size and rotation is not regular: petals are scaled within a range randomly, and rotated by random angle.
New flower is drawn on mouse click.
mousePressed(), redraw(),
function with parameter
../Sketches/CourseSketches/Flowers/Flower1r2/Flower1r2.jpg Flower1r2
Mod of Flower1: Flower with double petals in circle, size is randomly scaled, inner slightly smaller.
New flower is drawn on mouse click.

Stem with leaves - no applets from here on, but .pde

../Sketches/CourseSketches/Flowers/Mod21_14_1/Mod21_14_1.jpg Mod21_14_0 Mod21_14_1
Stem with bezier shaped leaves, places with random variation on left and right.
Multiple copies next to each other, redrawn on "c" key.
random()
bezierVertex()
../Sketches/CourseSketches/Flowers/Mod21_14_2/Mod21_14_2.jpg Mod21_14_2
Size and number of leaves changes based on mouse click coordinates.
Multiple copies next to each other, redrawn on "c" key.