private CustomPointsVertex[] CreateVertexArray() { var positions = Geometry.Positions.ToArray(); var vertexCount = Geometry.Positions.Count; var color = Color; var result = new CustomPointsVertex[vertexCount]; var colors = Geometry.Colors; for (var i = 0; i < vertexCount; i++) { Color4 finalColor; if (colors != null && colors.Any()) { finalColor = color * colors[i]; } else { finalColor = color; } result[i] = new CustomPointsVertex { Position = new Vector4(positions[i], 1f), Color = finalColor, Parameters = new Vector4((bool)GetValue(AttachedProperties.ShowSelectedProperty) ? 1 : 0, 0, 0, 0) }; } return(result); }
private CustomPointsVertex[] CreateVertexArray() { var positions = Geometry.Positions.ToArray(); var vertexCount = Geometry.Positions.Count; var color = Color; var result = new CustomPointsVertex[vertexCount]; var colors = Geometry.Colors; for (var i = 0; i < vertexCount; i++) { Color4 finalColor; if (colors != null && colors.Any()) { finalColor = color * colors[i]; } else { finalColor = color; } result[i] = new CustomPointsVertex { Position = new Vector4(positions[i], 1f), Color = finalColor, Parameters = new Vector4((bool)GetValue(AttachedProperties.ShowSelectedProperty) ? 1 : 0, 0, 0, 0) }; } return result; }