Ejemplo n.º 1
0
        public static Vector3 GetRandomInUnitSphere()
        {
            Vector3 pv;

            do
            {
                pv = (2.0f * new Vector3(RandomService.Nextfloat(), RandomService.Nextfloat(), RandomService.Nextfloat())) -
                     Vector3.One;
            }while (pv.LengthSquared() >= 1.0f);

            return(pv);
        }