Fixed UVs in Polygon (Circles)

This commit is contained in:
Michel Fedde 2020-12-13 13:19:46 +01:00
parent fca5502550
commit 1a0148ff90
2 changed files with 4 additions and 2 deletions

View file

@ -50,7 +50,8 @@ namespace SM2D.Object
private void AddUV(Vector2 vertex)
{
var uv = Vector2.Divide(vertex, BoundingBox.Max.Xy) + BoundingBox.Min.Xy;
var uv = Vector2.Divide(vertex - BoundingBox.Min.Xy, BoundingBox.Max.Xy - BoundingBox.Min.Xy);
uv.Y *= -1;
UVs.Add(uv);
}