Polygon doesn't get rendered

  • Anonymous - 2011-07-16


    I have several TAdPoints that I want to use to draw a Polygon. TAdCanvas.Polygon doesn't draw anything, TAdCanvas.Polyline and Spline however render everything fine. But I really need a Polygon that is filled with color.

    Also I was wondering if it is possible to render a second "scene" to a texture…?

    Kai Mast

  • Andreas Stöckel

    Make sure the polygon is rendered in the correct direction, as written in the documentation:

    Draws a simple polygon. The polygon points have to be in clockwise order and may not contain any intersections.

  • Andreas Stöckel

    Forgot to answer your second question: Yes, that's possible, see the "surface" demo.

  • Anonymous - 2011-07-22

    Okay that acutally seemed to be the problem. When I redraw the polygon Andorra2D sometimes doesn't to regonize that I've moved some of the points.

    Is there caching inside the Engine? Think I read that somewhere…

  • Anonymous - 2011-07-22

    Another thing. Is it possible to find out if a TAdPoint is inside an TAdPolygon? That would ease my development a lot….

  • Andreas Stöckel

    No, there's no direct function for this. You could triangulate the triangle and use the following functions


    But I think there is quite a lot of code for doing this in the internet. There is also a function for this in Numerical Recipes.


Log in to post a comment.