public static List <float[]> GetPoints(CoreSvg.Models.Rectangle rectangle) { return(new List <float[]> { new float[] { (float)rectangle.X, (float)rectangle.Y }, new float[] { (float)(rectangle.X + rectangle.Width), (float)rectangle.Y }, new float[] { (float)(rectangle.X + rectangle.Width), (float)(rectangle.Y + rectangle.Height) }, new float[] { (float)rectangle.X, (float)(rectangle.Y + rectangle.Height) } }); }
public static SvgMeshData GetMeshData(CoreSvg.Models.Rectangle rectangle, List <float[]> points, Color color) { var data = GetVertices(points).ToList(); var meshIndices = new List <int> { 0, 1, 2, 0, 2, 3 }; data.ForEach(v => { v.R = color.R / 255f; v.G = color.G / 255f; v.B = color.B / 255f; v.A = color.A / 255f; }); return(new SvgMeshData() { Vertices = data, Indices = meshIndices }); }