Difference between revisions of "L-system tree examples"

From Minetest Developer Wiki
Jump to navigation Jump to search
(Add acacia by VanessaE)
Line 11: Line 11:
 
<pre>
 
<pre>
 
treedef = {
 
treedef = {
axiom="FFFFFAFFBF",
+
axiom = {{{axiom}}},
rules_a="[&&&FFFFF&&FFFF][&&&++++FFFFF&&FFFF][&&&----FFFFF&&FFFF]",
+
rules_a = {{{rules_a}}},
rules_b="[&&&++FFFFF&&FFFF][&&&--FFFFF&&FFFF][&&&------FFFFF&&FFFF]",
+
rules_b = {{{rules_b}}},
trunk="default:tree",
+
rules_c = {{{rules_c}}},
leaves="default:leaves",
+
rules_d = {{{rules_d}}},
angle=30,
+
trunk = {{{trunk}}},
iterations=2,
+
leaves = {{{leaves}}},
random_level=0,
+
angle = {{{angle}}},
trunk_type="single",
+
iterations = {{{iterations}}},
thin_branches=true,
+
random_level = {{{random_level|0}}},
fruit_chance=10,
+
trunk_type = {{{random_level|"single"}}},
fruit="default:apple"
+
thin_branches = {{{thin_branches|true}}},
 +
fruit_chance = {{{fruit_chance}}},
 +
fruit = {{{fruit}}}
 
}
 
}
 
</pre>
 
</pre>
 +
 
=== Screenshot ===
 
=== Screenshot ===
 
[[File:Apple Tree.png|420px]]
 
[[File:Apple Tree.png|420px]]

Revision as of 18:28, 30 June 2015

This wiki page is a collection of example L-system trees. The intention is to help newbies better understand L-system trees, but also to provide usable tree definitions which could be used in mods.

If you wish to add a tree, please use the template at /Template and insert the filled-out template into this wiki page. Don't forget to upload a screenshot as well.

Apple tree

Profile

  • Subgame used: Minetest
  • Additional mods used: none

Definition

treedef = {
	axiom = {{{axiom}}},
	rules_a = {{{rules_a}}},
	rules_b = {{{rules_b}}},
	rules_c = {{{rules_c}}},
	rules_d = {{{rules_d}}},
	trunk = {{{trunk}}},
	leaves = {{{leaves}}},
	angle = {{{angle}}},
	iterations = {{{iterations}}},
	random_level = {{{random_level|0}}},
	trunk_type = {{{random_level|"single"}}},
	thin_branches = {{{thin_branches|true}}},
	fruit_chance = {{{fruit_chance}}},
	fruit = {{{fruit}}}
}

Screenshot

Apple Tree.png


Acacia

Profile

  • Subgame used: Minetest
  • Additional mods:
  • More Trees [moretrees]

Definition

treedef={
   axiom="FFFFFFccccA",
   rules_a = "[B]//[B]//[B]//[B]",
   rules_b = "&TTTT&TT^^G&&----GGGGGG++GGG++"   -- line up with the "canvas" edge
         .."fffffffGG++G++"               -- first layer, drawn in a zig-zag raster pattern
         .."Gffffffff--G--"
         .."ffffffffG++G++"
         .."fffffffff--G--"
         .."fffffffff++G++"
         .."fffffffff--G--"
         .."ffffffffG++G++"
         .."Gffffffff--G--"
         .."fffffffGG"
         .."^^G&&----GGGGGGG++GGGGGG++"      -- re-align to second layer canvas edge
         .."ffffGGG++G++"               -- second layer
         .."GGfffff--G--"
         .."ffffffG++G++"
         .."fffffff--G--"
         .."ffffffG++G++"
         .."GGfffff--G--"
         .."ffffGGG",
   rules_c = "/",
   trunk="moretrees:acacia_trunk",
   leaves="moretrees:acacia_leaves",
   angle=45,
   iterations=3,
   random_level=0,
   trunk_type="single",
   thin_branches=true,
}