コード例 #1
0
 public static Vector3FArrayList CreateRandomVector3FArray(int count, IFloatRandomNumberGenerator r)
 {
     Vector3FArrayList result  = new Vector3FArrayList(count);
     for(int i = 0; i < count; i++)
     {
         result.Add(new Vector3F(r.NextFloat(),r.NextFloat(), r.NextFloat()));
     }
     return result;
 }
コード例 #2
0
 /// <summary>
 /// Transform the vectors in the given array and put the result in another array.
 /// </summary>
 /// <param name="vectors">An array of vectors to transform.</param>
 /// <param name="transformation">The transformation.</param>
 /// <param name="result">An array of vectors to put the transformation results in (should be empty).</param>
 public static void TransformArray(Vector3FArrayList vectors, Matrix4F transformation, Vector3FArrayList result)
 {
     for (int i = 0; i < vectors.Count; i++)
     {
         result.Add(Matrix4F.Transform(transformation, vectors[i]));
     }
 }