From c4a240581bf04a04fb7570afb11c6f040b6ef8c4 Mon Sep 17 00:00:00 2001 From: Bartosz Hejduk Date: Sun, 11 Apr 2021 14:04:18 +0200 Subject: [PATCH] Added Anabeana rotating -20-20 angle task --- .../Assets/Scripts/AnabaenaTurtle.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cw1/unity_artifitial_world-st/Assets/Scripts/AnabaenaTurtle.cs b/cw1/unity_artifitial_world-st/Assets/Scripts/AnabaenaTurtle.cs index 4c9177c5..aeae4569 100644 --- a/cw1/unity_artifitial_world-st/Assets/Scripts/AnabaenaTurtle.cs +++ b/cw1/unity_artifitial_world-st/Assets/Scripts/AnabaenaTurtle.cs @@ -21,10 +21,10 @@ public class AnabaenaTurtle : TurtleLSystem { var r = (GameObject)AssetDatabase.LoadAssetAtPath(String.Format(path, "r"), typeof(GameObject)); //creating functions that are used for interpretation - turtleInterpretation.Add("l", (float[] args) => new Tuple(l, 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(r, 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(bigL, 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(bigR, 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(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(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(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(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)))); } } \ No newline at end of file