SFML community forums

Help => Graphics => Topic started by: Despairy on March 26, 2012, 04:07:30 pm

Title: Polygon problem. adding points the right way getting weird image?
Post by: Despairy on March 26, 2012, 04:07:30 pm
hi i tried to make a tetris polygon
the FLIPPED L shape and this is what i get

(http://imageshack.us/photo/my-images/38/goodab.gif)
http://imageshack.us/photo/my-images/38/goodab.gif

if you see the points are inserted in the right order
top left
top right
bottom right
bottom middle
middle middle
middle left

for some reason the shape is all messed up
any ideas? debugging showed the points are inserted well and i HAVE NO CLUE!

thanks!
Title: Re: Polygon problem. adding points the right way getting weird image?
Post by: Laurent on March 26, 2012, 04:25:10 pm
Your shape is not convex (http://en.wikipedia.org/wiki/Convex), you cannot use SFML shape classes.
Title: Re: Polygon problem. adding points the right way getting weird image?
Post by: Despairy on March 26, 2012, 04:43:56 pm
didnt know that ... O_O thanks
Title: Re: Polygon problem. adding points the right way getting weird image?
Post by: eXpl0it3r on March 26, 2012, 04:47:00 pm
didnt know that ... O_O thanks

It's written in the documentation (http://www.sfml-dev.org/documentation/2.0/)...  ::)

Btw if you don't want to write your own class, the Thor (http://en.sfml-dev.org/forums/index.php?topic=7329.0) library has already one.