Added Anabeana rotating -20-20 angle task
This commit is contained in:
parent
b05013b6df
commit
c4a240581b
@ -21,10 +21,10 @@ public class AnabaenaTurtle : TurtleLSystem {
|
|||||||
var r = (GameObject)AssetDatabase.LoadAssetAtPath(String.Format(path, "r"), typeof(GameObject));
|
var r = (GameObject)AssetDatabase.LoadAssetAtPath(String.Format(path, "r"), typeof(GameObject));
|
||||||
|
|
||||||
//creating functions that are used for interpretation
|
//creating functions that are used for interpretation
|
||||||
turtleInterpretation.Add("l", (float[] args) => new Tuple<GameObject, Matrix4x4>(l, Matrix4x4.Translate(new Vector3(0.1f, 0, 0)) * Matrix4x4.Scale(new Vector3(0.1f, 0.1f, 0.1f))));
|
turtleInterpretation.Add("l", (float[] args) => new Tuple<GameObject, Matrix4x4>(l, Matrix4x4.Rotate(Quaternion.Euler(0, 0, UnityEngine.Random.Range(-20, 20))) * Matrix4x4.Translate(new Vector3(0.1f, 0, 0)) * Matrix4x4.Scale(new Vector3(0.1f, 0.1f, 0.1f))));
|
||||||
turtleInterpretation.Add("r", (float[] args) => new Tuple<GameObject, Matrix4x4>(r, Matrix4x4.Translate(new Vector3(0.1f, 0, 0)) * Matrix4x4.Scale(new Vector3(0.1f, 0.1f, 0.1f))));
|
turtleInterpretation.Add("r", (float[] args) => new Tuple<GameObject, Matrix4x4>(r, Matrix4x4.Rotate(Quaternion.Euler(0, 0, UnityEngine.Random.Range(-20, 20))) * Matrix4x4.Translate(new Vector3(0.1f, 0, 0)) * Matrix4x4.Scale(new Vector3(0.1f, 0.1f, 0.1f))));
|
||||||
turtleInterpretation.Add("L", (float[] args) => new Tuple<GameObject, Matrix4x4>(bigL, Matrix4x4.Translate(new Vector3(0.1f, 0, 0)) * Matrix4x4.Scale(new Vector3(0.1f, 0.1f, 0.1f))));
|
turtleInterpretation.Add("L", (float[] args) => new Tuple<GameObject, Matrix4x4>(bigL, Matrix4x4.Rotate(Quaternion.Euler(0, 0, UnityEngine.Random.Range(-20, 20))) * Matrix4x4.Translate(new Vector3(0.1f, 0, 0)) * Matrix4x4.Scale(new Vector3(0.1f, 0.1f, 0.1f))));
|
||||||
turtleInterpretation.Add("R", (float[] args) => new Tuple<GameObject, Matrix4x4>(bigR, Matrix4x4.Translate(new Vector3(0.1f, 0, 0)) * Matrix4x4.Scale(new Vector3(0.1f, 0.1f, 0.1f))));
|
turtleInterpretation.Add("R", (float[] args) => new Tuple<GameObject, Matrix4x4>(bigR, Matrix4x4.Rotate(Quaternion.Euler(0, 0, UnityEngine.Random.Range(-20, 20))) * Matrix4x4.Translate(new Vector3(0.1f, 0, 0)) * Matrix4x4.Scale(new Vector3(0.1f, 0.1f, 0.1f))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user