public PolygonManager(int p, int q, Material mat) { polygon = new FundamentalPolygon(p, q, mat, null, null, null); polygon.toKleinBeltrami(true); polygon.foldOut(3); // foreach (var item in polygon.polygons) { // item.foldOut (); // } }
public void foldOut(int k) { if (k > 0) { polygons = new FundamentalPolygon[p]; for (int i = 0; i < p; i++) { if (i != isSide) { polygons [i] = new FundamentalPolygon(p, q, mat, gameObject, originalPositions, inversionCircleCenters, i, "" + i); polygons [i].mirrorAt(i, true); polygons [i].toKleinBeltrami(true); polygons [i].foldOut(k - 1); } } } // var obj = GameObject.FindGameObjectWithTag ("Finish"); // polygons [i] = new FundamentalPolygon (p, q, mat, gameObject, originalPositions, inversionCircleCenters, "" + i); // if (i == 1) { // polygons [i].mirrorAt (1); // polygons [i].toKleinBeltrami (); // polygons [i].foldOut (2); // // // } // if (i == 0) { // polygons [i].mirrorAt (0); // polygons [i].toKleinBeltrami (); // polygons [i].foldOut (1); // // for (int k = 0; k < p; k++) { // var corner1 = GameObject.Instantiate (obj); // corner1.transform.position = polygons [i].filter.mesh.vertices [k] * factor + (polygons [i].filter.mesh.vertices [p] - polygons [i].filter.mesh.vertices [k]) * factor * 0.1f; // corner1.GetComponent <TextMesh> ().text = "" + k; // } // } // if (i == 2) { // polygons [i].mirrorAt (2); // polygons [i].toKleinBeltrami (); // // for (int k = 0; k < p; k++) { // var corner1 = GameObject.Instantiate (obj); // corner1.transform.position = polygons [i].filter.mesh.vertices [k] * factor + (polygons [i].filter.mesh.vertices [p] - polygons [i].filter.mesh.vertices [k]) * factor * 0.1f; // corner1.GetComponent <TextMesh> ().text = "" + k; // } // } }