public void AddRandomPoints() { string[] clrs = { "black", "lilac", "yellow", "orange", "red" }; if (ranpoints == null) { ranpoints = new GameObject("ranpoints"); ranpoints.transform.position = Vector3.zero; ranpoints.transform.parent = preferedParent.transform; } var ska = qmm.triDiag * 0.025f; //var lmn = 0.1f; //var lmx = 0.9f; var lmn = -0.1f; var lmx = 1.1f; for (int i = 0; i < 10000; i++) { var lambLat = qut.GetRanFloat(lmn, lmx, "ranpoints"); var lambLng = qut.GetRanFloat(lmn, lmx, "ranpoints"); (var vv, var nrm, var istat) = qmm.GetWcMeshPosFromLambda(lambLng, lambLat); var pos = vv; var name = "ranpt:" + nranpts; //SphInfo.DoInfoSphere(ranpoints, name, pos, ska, clrs[istat], addSphInfo: false); var sphgo = GpuInst.CreateSphereGpu(name, pos, ska, clrs[istat]); sphgo.transform.parent = ranpoints.transform; nranpts++; } }
public static SphInfo DoInfoSphereSlim(GameObject parent, string sname, Vector3 pos, float ska, string color, LatLng ll = null, bool addSphInfo = true) { var sphtran = GpuInst.CreateSphereGpu(sname, pos, ska, color); sphtran.transform.parent = parent.transform; SphInfo spi = null; if (addSphInfo) { spi = sphtran.gameObject.AddComponent <SphInfo>(); spi.latLng = ll; spi.nodeInfo = null; } return(spi); }