{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# by Doug and Doug"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {
"collapsed": false,
"format": "column"
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%processing\n",
"void setup() {\n",
" size(500, 500);\n",
"}\n",
"\n",
"void drawTree(float x, float y, float scale) {\n",
" fill(128, 128, 0);\n",
" stroke(0);\n",
" rect(x - scale * 25, y, \n",
" scale * 25, scale * 100);\n",
" fill(0, 128, 128);\n",
" float diff = 100 * scale;\n",
" float offset = scale * 10 + random(2);\n",
" ellipse(x, y, diff, diff);\n",
" ellipse(x + offset, y - offset, \n",
" diff, diff);\n",
" ellipse(x - offset, y - offset, \n",
" diff, diff);\n",
"}\n",
"\n",
"void drawCloud(float x, float y, float scale) {\n",
" fill(255, 255, 255, 200);\n",
" stroke(255, 255, 255, 200);\n",
" float height = scale * 50 + random(5);\n",
" float width = scale * 100 + random(2);\n",
" ellipse(x, y, scale * 100, height);\n",
" ellipse(x + 25 * scale, y - 25 * scale, \n",
" width, height);\n",
" ellipse(x - 20 * scale, y - 25 * scale, \n",
" width, height);\n",
" noStroke();\n",
"}\n",
"\n",
"void draw() {\n",
" fill(0, 0, 255);\n",
" rect(0, 0, 500, 250);\n",
" fill(0, 255, 0);\n",
" rect(0, 250, 500, 500);\n",
" drawCloud(0, 100, 2.0);\n",
" drawCloud(300, 150, 2.0);\n",
" drawTree(175, 250, 0.25);\n",
" drawTree(220, 250, 0.25);\n",
" drawTree(150, 250, 0.5);\n",
" drawTree(250, 250, 0.5);\n",
" drawTree(50, 300, 1.5);\n",
" drawTree(350, 300, 1.5);\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"format": "column"
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Calysto Processing",
"language": "java",
"name": "calysto_processing"
},
"language_info": {
"codemirror_mode": {
"name": "text/x-java",
"version": 2
},
"file_extension": ".java",
"mimetype": "text/x-java",
"name": "java"
}
},
"nbformat": 4,
"nbformat_minor": 1
}