My code creates a set containing 30 points which I then use to draw a polygon using orxDisplay_FillPolygon() function. Everything's fine when I do not fill it:
But when I set the last argument to 'true' it looks like this:
Am I doing something wrong?
Comments
Do you mind giving me your list of points so that I can try it on my side?
Also, on which platform have you tried?
List of points is generated on the fly. This headless cat consists of several body parts connected by revolute joints. I'm taking top left corner coordinates of each body part (orxObject_GetWorldPosition()) and calculating other corners as needed.
Here's the render event handler (sorry for the messy code):
http://pastie.org/3657106
And config file with body parts:
http://pastie.org/3657129
I'll look into that tonight. At first glance I don't see any issue with your code. I can think of a couple of things to make things easier on your side though, but that will be for when things are working fine.
The problem comes from the fact your polygons can't be drawn in filled mode due to their shape. I updated the doxygen doc to be more explicit for the orxDisplay_DrawPolygon() function.
Only convex or star-shaped concave polygons whose first vertex is part of the polygon kernel can be directly drawn with that function. This is a common issue with 3D polygon rendering.
For more complex polygons you'll need to decompose your polygons into smaller convex polygons for example (the easiest way often being to triangulate it).
Or using sprites would make it probably much easier to handle.
As for making your life easier, you can actually replace the rendering of the objects themselves with yours and use the orxFRAME hierachy to get the positions without having to do all the transformations yourself. I'll try to write an example during the week end if you want.
Sorry it slipped out of my mind during the week end so I'll try to do that in the coming days.