Using spherical trigonometry and the golden ratio to find the angles of the major node connector
public void ArgosVoronoi(bool bDoNeighbors) { Vector3 vForce; Vector3 vAccumForce; float dist_sqd; float fMag = 0; float delta = 0.004f; foreach (GO_Tracker gActedUpon in lstHex_GO) { vAccumForce = Vector3.zero; foreach (GO_Tracker gPushing in lstHex_GO) { if (gActedUpon != gPushing) { vForce = gActedUpon.aVNode.vPos - gPushing.aVNode.vPos; dist_sqd = vForce.x * vForce.x + vForce.y * vForce.y + vForce.z * vForce.z; vAccumForce += vForce.normalized / dist_sqd; if (bDoNeighbors) { gActedUpon.aVNode.insNeighbor_One_Shot(dist_sqd, gPushing.aVNode); } } } fMag = vAccumForce.magnitude; vAccumForce = vAccumForce.normalized; gActedUpon.aVNode.vForce = 3000f * vAccumForce; gActedUpon.aVNode.vPos += gActedUpon.aVNode.vForce * (delta * delta); gActedUpon.aVNode.vPos = gActedUpon.aVNode.vPos.normalized; gActedUpon.aVNode.vPos *= m_fRadius; } }
Fibinacci_Voronoi – 3:50am 4-26-16