Learn creative coding writing simple programs
122. Programming roses and other flowers
In this episode we take a formula found on a Wikipedia page, and convert it into a Processing program that draws a simple flower. Ok, maybe you need some imagination to see the flower, but still.
The only new concept discovered in this episode is the scale() function, which modifies the coordinate system. This allows drawing larger and smaller figures without changing the x and y values used.
scale() can be used in conjuction to translate() and rotate(). All three functions modify the axes in one way or another.
Code editor
You can make changes to the code below. Then
Reference
background
colorMode
cos
draw
float
frameCount
height
line
scale
setup
sin
size
stroke
strokeWeight
translate
void
width
background
colorMode
cos
draw
float
frameCount
height
line
scale
setup
sin
size
stroke
strokeWeight
translate
void
width
Try to stay close to the topic of this episode. Use the Processing forums for help with unrelated Processing projects (or hire me for help ;-)
To indicate that a word in your comment is code, use the `backtick`. Example
Do `float` and `int` smell similar?
To highlight code blocks, surround it with ``` code-fences ``` like this:``` void setup() { size(600, 600); } ```