General discussion about LÖVE, Lua, game development, puns, and unicorns.
Mercurialol
Prole
Posts: 13 Joined: Fri Apr 18, 2014 3:14 pm
Post
by Mercurialol » Tue Aug 12, 2014 9:30 pm
Drawing a rotated rectangle as a polygon is missing one side. It's a
simple polygon, but math.isConvex returns false, even though it's a perfectly rotated rectangle (by 45 degrees). Any ideas ?
Code: Select all
love.graphics.setColor(255, 80, 0)
love.graphics.polygon('fill', 320, 0, 350, 30, 280, 40, 310, 70)
Thanks in advance
Mercurial
Ref
Party member
Posts: 702 Joined: Wed May 02, 2012 11:05 pm
Post
by Ref » Wed Aug 13, 2014 1:15 am
It's because your polygon is NOT convex (not even a valid polygon)!
Try interchanging the last two points.
Code: Select all
love.graphics.polygon('fill', 320, 0, 350, 30, 310, 70, 280, 40)
Just if you haven't already figured this out.
Users browsing this forum: Ahrefs [Bot] , Bing [Bot] and 1 guest