photo: Romanesco broccoli
I started playing with fractal shaders and in particularity I wanted to reproduce romanesco broccoli in SL. At first it was just a simple experiment but after each obstacle I got more persistent so eventually I discovered the world of calculus.
I'm going to skip the theory part about phyllotaxis, Fibonacci etc and get straight to the shader math. Good site that explains it all is: http://www.math.smith.edu/phyllo/
Most of the math was found on Wolfram and WikiPedia pages
First off we need to convert our UVs from cartesian to polar coordinate system
r = sqrt( pow( x, 2 ) + pow( y, 2 ));
Next, Golden Angle for distribution pattern.
theta = atan( x, y) + PI;
// Note that PI offset has been added for polar translation
// equation to work (for secondary florets)
To draw a secondary florets or a circle on polar coordinates we can use polar translation equations
golden = PI*(3-sqrt(5));
r2 = sqrt(r*r-2*r*r0*cos( theta-th0 )+r0*r0);