SFML community forums

Help => Graphics => Topic started by: b3ngr33ni3r on March 19, 2012, 09:21:05 pm

Title: SFML2 ConvexShape setFillColor Error
Post by: b3ngr33ni3r on March 19, 2012, 09:21:05 pm
Hey guys, so basically what i'm seeing is when creating a convex shape, the setFillColor isn't just effecting the inside of the convex shape, it's effecting the outside slightly. it's fairly difficult to explain, but when the convex shape points drop below a certain point, the fill color is show above it.
For instance,
(http://dl.dropbox.com/u/2644125/WaterChainProblem.png)
http://dl.dropbox.com/u/2644125/WaterChainProblem.png

Any help/guidance/explanations would be greatly appreciated.
Title: SFML2 ConvexShape setFillColor Error
Post by: julen26 on March 19, 2012, 10:08:58 pm
http://www.sfml-dev.org/documentation/2.0/classsf_1_1ConvexShape.php#details

Quote
It is important to keep in mind that a convex shape must always be... convex, otherwise it may not be drawn correctly.


Your shape isn't convex.

Non-convex
(http://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Convex_polygon_illustration2.png/220px-Convex_polygon_illustration2.png)
Convex
(http://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Convex_polygon_illustration1.png/220px-Convex_polygon_illustration1.png)
Title: SFML2 ConvexShape setFillColor Error
Post by: b3ngr33ni3r on March 19, 2012, 11:29:26 pm
Oh wow, my bad.
thanks.