Beispiel #1
0
    //generates a mesh from a l system ruleset
    public Mesh MeshFromRuleset(int idx)
    {
        //create L system
        LSystem ls            = new LSystem(_rulesets[idx]._axiom, _iterationCount, _rulesets[idx]);
        string  lSystemOutput = ls.Generate();

        //use turtle to create mesh of L system
        Turtle turtle = new Turtle(_rulesets[idx]._angle);

        turtle.Decode(lSystemOutput);
        turtle.CreateMesh();

        Mesh mesh = turtle._finalMesh;

        return(mesh);
    }