/// <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(Vector3DArrayList vectors, Matrix4D transformation, Vector3DArrayList result) { for (int i = 0; i < vectors.Count; i++) { result.Add(Matrix4D.Transform(transformation, vectors[i])); } }
/// <summary> /// Transform the vectors in the given array. /// </summary> /// <param name="vectors">An array of vectors to transform.</param> /// <param name="transformation">The transformation.</param> /// <remarks> /// This method changes the vector values in the <paramref name="vectors"/> array. /// </remarks> public static void TransformArray(Vector3DArrayList vectors, Matrix4D transformation) { for (int i = 0; i < vectors.Count; i++) { vectors[i] = Matrix4D.Transform(transformation, vectors[i]); } }
public static Vector3DArrayList CreateRandomVector3DArray(int count, IDoubleRandomNumberGenerator r) { Vector3DArrayList result = new Vector3DArrayList(count); for (int i = 0; i < count; i++) { result.Add(new Vector3D(r.NextDouble(), r.NextDouble(), r.NextDouble())); } return(result); }
/// <summary> /// Initializes a new instance of the <see cref="Polygon"/> class with serialized data. /// </summary> /// <param name="info">The object that holds the serialized object data.</param> /// <param name="context">The contextual information about the source or destination.</param> protected Polygon(SerializationInfo info, StreamingContext context) { _points = (Vector3DArrayList)info.GetValue("Points", typeof(Vector3DArrayList)); }
/// <summary> /// Initializes a new instance of the <see cref="Polygon"/> class using coordinates from another instance. /// </summary> /// <param name="polygon">A <see cref="Polygon"/> instance.</param> public Polygon(Polygon polygon) { _points = (Vector3DArrayList)polygon._points.Clone(); }
/// <summary> /// Initializes a new instance of the <see cref="Polygon"/> class using an array of coordinates. /// </summary> /// <param name="points">An <see cref="Vector3DArrayList"/> instance.</param> public Polygon(Vector3DArrayList points) { _points.AddRange(points); }