   Lookup for random point along shape
  I would like to generate random points along the edge of a polygon, but only along the edges facing upwards. The polygon gets moved around a lot.I use a lookup table to distribute the points evenly, where each edge is weighed by it's length, as discussed here: http://www.gamedev.net/community/forums/topic.asp?topic_id=554839At the moment I create a new lookup table each frame containing only the upwards-facing edges, but this is too slow.Is there some way I can use a single lookup table for this?I had the idea of an indexing system, but thought I'd ask for some advice first.Thanks!   
  The simplest solution I can think of is generating a random point on the contour of the polygon (weighing the sides in proportion to their length is exactly the right way to do that), and then check if the side you got is facing up or not. Keep picking random points until one of them satisfies your criterion.