unity3d – Ashwin Sinha

Getting a random point between two concentric circles in Unity3D

Getting a random point between two concentric circles in Unity3D /// <summary> /// Returns a random point in the space between two concentric circles. /// </summary> /// <param name=”minRadius”></param> /// <param name=”maxRadius”></param> /// <returns></returns> Vector3 GetRandomPointBetweenTwoCircles(float minRadius, float maxRadius) { //Get a point on a unit circle (radius = 1) by normalizing a random point […]

Find a random point between two Vector3 points.

Find a random point between two Vector3 points.   GetRandomVector3Between.cs /// <summary> /// Returns a random vector3 between min and max. (Inclusive) /// </summary> /// <returns>The <see cref=”UnityEngine.Vector3″/>.</returns> /// <param name=”min”>Minimum.</param> /// <param name=”max”>Max.</param> /// https://gist.github.com/Ashwinning/269f79bef5b1d6ee1f83 public Vector3 GetRandomVector3Between (Vector3 min, Vector3 max) { return min + Random.Range (0, 1) * (max – min); } /// […]