예제 #1
0
파일: Tree7.cs 프로젝트: miiaremahl/Lsystem
    //creates a tree by calling the general tree class
    private void createTree()
    {
        //rules for F (33.33~ change of choosing the rule)
        string[] fRules = { "F[+F]F[-F]F", "F[+F]F", "F[-F]F" };

        //rules
        rules = new Dictionary <char, string[]>
        {
            { 'F', fRules }
        };

        //start
        start = "F";

        //create tree with generic tree class
        tree.CreateTree(rules, start, iterations, length, angle, iterationMax);
    }
예제 #2
0
파일: Tree8.cs 프로젝트: miiaremahl/Lsystem
    //creates a tree by calling the general tree class
    private void createTree()
    {
        //rules for V
        string[] vRules = { "[+++W][---W]YV" };

        //rules for W
        string[] wRules = { "+X[-W]Z" };

        //rules for X
        string[] xRules = { "-W[+X]Z" };

        //rules for Y
        string[] yRules = { "YZ" };

        //rules for Z
        string[] zRules = { "[-FFF][+FFF]F" };

        //rules
        rules = new Dictionary <char, string[]>
        {
            { 'V', vRules },
            { 'W', wRules },
            { 'X', xRules },
            { 'Y', yRules },
            { 'Z', zRules },
        };

        //set max iterations
        iterationMax = 11;

        //start
        start = "VZFFF";

        //create tree with generic tree class
        tree.CreateTree(rules, start, iterations, length, angle, iterationMax);
    }