Пример #1
0
 /// <summary>
 /// Creates a linear interpolation of this vertex.
 /// </summary>
 /// <param name="anotherVertex">Another vertex used in interpolation.</param>
 /// <param name="position">     Interpolation parameter.</param>
 /// <returns>
 /// A new vertex located on the line between this vertex and another one, with relative
 /// position described by an interpolation parameter.
 /// </returns>
 public IVertex CreateLinearInterpolation(MeshVertex anotherVertex, float position)
 {
     return(new MeshVertex
     {
         Position = Vector3.CreateLinearInterpolation(this.Position, anotherVertex.Position, position),
         Normal = Vector3.CreateLinearInterpolation(this.Normal, anotherVertex.Normal, position).Normalized,
         UvMapPosition = Vector2.CreateLinearInterpolation(this.UvMapPosition, anotherVertex.UvMapPosition, position),
         PrimaryColor = Color32.CreateLinearInterpolation(this.PrimaryColor, anotherVertex.PrimaryColor, position),
         SecondaryColor = Color32.CreateLinearInterpolation(this.SecondaryColor, anotherVertex.SecondaryColor, position)
     });
 }