header

 

More links

AutoHotkey | Android | Arduino | COMM140Fractals | Grammar Checkers | Knots | A Million Dots Activity |  Processing | Processing for Scratch Users | Redbubble | Tutorials | Weather | World Time Meeting Planner | Favicon Generator.

Home > Tutorials > Processing > Processing Examples > Evolution of Xanthoria 001 > Evolution of Xanthorrhoea 001_2

Evolution of Xanthorrhoea 001_2

 

2010-10-20_0546.png

Comments:

In this version I have created a procedure void xanthorrhoea that will draw a simple trunk

processing code

// Author: Rupert Russell
// Title: xanthorrhoea 001.2
// Date: October 20, 2010

void setup() { size(300, 300); smooth(); noLoop(); } // end of viod setup

void draw() { int trunk_width; int trunk_height; float lean; int start_x; int start_y; // draw first trunk trunk_width = 25; trunk_height = 150; lean = 0.1; start_x = width /3; start_y = height - 20; xanthorrhoea(trunk_width, trunk_height, lean, start_x, start_y); // draw second trunk trunk_width = 35; trunk_height = 170; lean = -0.11; start_x = width /2 + 20; start_y = height; xanthorrhoea(trunk_width, trunk_height, lean, start_x, start_y); } // end void draw() void xanthorrhoea(int trunk_width, int trunk_height, float lean, int start_x, int start_y){ // draw trunk float step = 0.7; for (int counter = 0; counter < trunk_height; counter ++){ strokeWeight(random(0.2, 2)); float rand_y = random(0.2, 5); float rand_x = random(10); line(start_x + rand_x + (lean * counter) , start_y - (step * counter) - rand_y , start_x + trunk_width + rand_x + (lean * counter), start_y - (step * counter) - rand_y * 2 ); } // end of for loop } // end of viod xanthorrhoea
code formatter

 


APA citation:
Russell, R. (2016, July 05, 07:26 am). Evolution of Xanthorrhoea 001_2.
     Retrieved November 22, 2024, from http://www.rupert.id.au/tutorials/processing/examples/xanthorrea001/001_2.php

Last refreshed: November 22 2024. 04:39.08 pm

rupert dot russell at acu dot edu dot au Support Wikipedia

Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.


437 visits since October 20, 2010