/// <summary> /// Draws an irregeular cone /// </summary> /// <param name="strains">The x,y,z,w radii</param> /// <param name="top">The position of the top of the cone</param> /// <param name="L1">The direction of the cone</param> /// <param name="rot">The rotation of the cone</param> /// <param name="resolution">The amount of lines the cone shoud be drawn from</param> /// <param name="scale">The height of the cone</param> public static void CreateIrregularCone(OpenTK.Vector4 strains, OpenTK.Vector3 top, OpenTK.Vector3 L1, OpenTK.Quaternion rot, int resolution, float scale) { L1.Normalize(); List<OpenTK.Vector3> positions = new List<OpenTK.Vector3>(); positions.AddRange(GetQuarter(strains.X, strains.Y, top, L1, rot, resolution, 1, scale)); positions.AddRange(GetQuarter(strains.Z, strains.Y, top, L1, rot, resolution, 2, scale)); positions.AddRange(GetQuarter(strains.Z, strains.W, top, L1, rot, resolution, 3, scale)); positions.AddRange(GetQuarter(strains.X, strains.W, top, L1, rot, resolution, 4, scale)); OpenTK.Vector3 prev = positions.First(); Color c; Color c2 = Color.black; int i = 0; foreach (OpenTK.Vector3 v in positions) { float part = ((float)i % ((float)resolution / 4f)) / ((float)resolution / 4f); if (i < resolution * 0.25) { //Q1 c = Color.Lerp(Color.blue, Color.red, part); } else if (i < resolution * 0.5) { //Q4 c = Color.Lerp(Color.red, Color.green, part); } else if (i < resolution * 0.75) { //Q3 c = Color.Lerp(Color.green, Color.yellow, part); } else { //Q2 c = Color.Lerp(Color.yellow, Color.blue, part); } i++; DrawLine(v, prev , c2); DrawLine(top, v , c); prev = v; } c = Color.blue; DrawLine(prev, positions.First(), c); DrawLine(top, positions.First(), c); //return positions.ToArray(); }