title: AS3 - drawPath() & winding overlaps producing strange behavior
body: <p>I'm trying to draw multiple shapes in the same Sprite.graphics scope, and can't seem to find any reasonable solution to my problem.</p>
  
  <p>Please keep in minde that I've been using the drawPath() method for a performance problem : I could use multiple shapes with blendmodes, but I'd like to avoid that and keep performances cost to the minimum.</p>
  
  <p>I've been experimenting with the winding parameter of the drawPath() method, but one thing that I cannot understand, is how the winding direction is defined by Flash, so here is a first question before actually coming to the real problem : 
  Are points coordinates taken in account ? Or is it the angle between the produces lines that define the direction ?</p>
  
  <p>That being said, here is my actual problem : 
  I want to draw a shape that is a projection from a rectangle on a line - think of a window and the light that passes through it that goes hit the floor.</p>
  
  <p><img src="https://i.stack.imgur.com/GAb2U.jpg" alt="enter image description here"></p>
  
  <p>To achieve that, I must take into account that the lightsource position can vary and have that kind of results :</p>
  
  <p><img src="https://i.stack.imgur.com/d6yvg.jpg" alt="enter image description here"></p>
  
  <p>Here on that second picture you can already see the problem I'm facing.
  To draw my shape, I've been separately "drawing" (understand : placing the numbers in my coordinates vector) the different parts of my figure : the actual rectangle I want to project, the light projected from its left side, the light projected from its bottom side, and the light projected from its right side.</p>
  
  <p>I've been trying to carefully keep the winding direction the same in every section, beginning from the top-left corner, but it seems something is wrong in my reasoning, since every time the center part overlaps with any side part, the shape is emptied there, and every time the two sides parts overlaps, the same happens.</p>
  
  <p>As I'm writing that here, some revelation suddenly strike me, and now I guess that maybe <strong>ALL my points</strong> in my coordinates vector must be sorted in the same winding direction for my shape to work ?... (and not only the small parts I'm separately drawing in my mind ^^)</p>
  
  <p>If I'm right (please correct me if I'm not, or if I've understood anything wrong ?...), that means I must either :</p>
  
  <ul>
  <li><p>sort my points to be placed in the correct winding direction (thing that might be complicated and could result in some strange drawed shape once provided to the drawing API ?...)</p></li>
  <li><p>only draw the shape from the most external points, depending on the shape's actual shape (thing that might be more complicated that I currently expect).</p></li>
  </ul>
  
  <p>Could anyone here confirm or infirm my last suppositions, and give me a clue on what could be going on here and how to solve it ?...</p>
  
  <p>Thanks a lot :-)</p>