View Single Post
  #4  
Old 04-21-2007, 10:12 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
I'm assuming the shade on the thing holding the chest is not supposed to be there... If so, for each point, check to see if the ray extending from Point A crosses the line extending from the point that is specified 2 after the original point (Point C), with Point B between the two of them.

Any two lines cross at x=-(b1-b2)/(m1-m2). So, save an array as {-(b1-b2)/(m1-m2),m1*(-(b1-b2)/(m1-m2))+b1}, where y=m1x+b1 is the equation on the line going through Point A, and the same with 2s for Point C, to get the point at which the two rays cross. This will be Point M. Now, all you have to do, is in your polygon's array of points is replace ..., Point B, Point C, ... with ..., Point M, Point C, Point B, Point M, ... and the are will not be overlap anymore.

So basically, you're just keeping the shape by defining the "bend" and switching the points that cause the overlap.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote