Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Polygon doesn't get rendered

General
Anonymous
2011-07-16
2013-05-14

  • Anonymous
    2011-07-16

    Hey,

    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…?

    greetings,
    Kai Mast

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

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

     
  • 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….

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

    http://andorracommons.sourceforge.net/docs/index.php?p=AdPolygonUtils

    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.