# Growing syringa

by NightElfik

Short link: http://malsys.cz/g/tSvYmA8w

Loading 3D model

of Growing syringa

### Comments

comments powered by Disqus### Source code

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | lsystem LilacInflorescences extends Branches { // A(energy, branchEnergy) set symbols axiom = F(50) A(12, 5); set iterations = 11; set cameraPosition = {232, 130, 202}; set cameraUpVector = {0.6, 0.78, -0.2}; set cameraTarget = {221, 4, 7}; interpret F as DrawForward(10, 2, #00AA00); interpret K(age) as lsystem Bloom(age); interpret + as Pitch(60); interpret - as Pitch(-60); interpret / as Roll(90); rewrite A(energy) where energy <= 0 to K(1); rewrite A(energy, branchEnergy) to [ - / K(1) ] [ + / K(1) ] I(0, branchEnergy) / A(energy - 1, branchEnergy); rewrite I(t, energy) where energy <= 0 to nothing; rewrite I(t, energy) with e = energy - 1, be = energy where t == 2 to I(t + 1, e) [ - F F A(e, be) ] [ + F F A(e, be) ]; rewrite I(t, e) to F I(t + 1, e - 1); rewrite K(age) to K(age + 1); } abstract lsystem Bloom(age = 4) extends Polygons { let color = #d649ff; let leafCount = round(random(3.5, 5.5)); let angle = 150 / leafCount; let size = min(4, age); set symbols axiom = F [ G(1.5) K ] leaf; set iterations = leafCount; interpret F as DrawForward(size * 2.5, 1 + size / 4, color); interpret G as MoveForward(size * 2.5); interpret K as DrawSphere(size / 2, #ffff00); interpret + as Yaw(angle); interpret - as Yaw(-angle); interpret | as Yaw(180); interpret / as Roll; interpret ^ as Pitch(-15); rewrite leaf to /(360 / leafCount) [ ^(40 + 10*size) <(color) . + ^ G . - ^ G . - ^ G . + | + G . - ^ G . > ] leaf; } process all with ThreeJsRenderer; |

### Thumbnail extension

1 2 3 4 5 | process all with ThreeJsRenderer set iterations = 8 set cameraPosition = {153, 113, 80} set cameraUpVector = {0.53, 0.67, -0.52} set cameraTarget = {140, -4, -4}; |