Vector4 calculateTorusPoint(int i) { float alpha = 6.28318530718f * (i / (float)ELEMENTS); float voltage = Mathf.Sin(((alpha + (Time.time * speed)) * (constantCurrent ? frequencyOverTotalLength : numberOfWinds))); //alpha += (Time.time * speed); //alpha %= 6.28f; float wind = alpha * numberOfWinds; Vector3 torusPoint = Torus.encodeToThreeTorus(alpha, wind); return(new Vector4(torusPoint.x, torusPoint.z, torusPoint.y, voltage)); }
Vector4 calculateTorusPoint(int i) { float alpha = 6.28318530718f * (i / 1024f); float voltage = Mathf.Sin((alpha * windingNumber)); alpha += (Time.time * speed); //alpha %= 6.28f; float wind = alpha * windingNumber; Vector3 torusPoint = Torus.encodeToThreeTorus(alpha, wind); return(new Vector4(torusPoint.x, torusPoint.z, torusPoint.y, voltage)); }