Skip to main content

Posts

Showing posts from February, 2013

Cut Thy Polygon

Fruit Ninja is an awesome game.. very addictive.. and fun to play.. but if you observe carefully you will see that where ever you slash the fruit.. it is always cut in half.. It is a simple trick to keep things nice and fast. But imagine if you could cut and slice a fruit every which way you wanted precisely the way you wanted.. this is an idea i had for a while.. Slicing enemies into pieces based on slashes. Slicing fruits based on the slashs Creating predefined shapes from a starting shape  and the list goes on.. and it all starts with a line intersecting a polygon and the polygon being cut into two polygons. Before we go any further here are the screens of how the result will look. After 1 cut After two cuts After 3 Cuts Now lets get to the most important part.. Cutting a polygon into two pieces. For each Edge in the polygon:       if Cut bisects Edge           Find point of intersection of Cut line and Edge of polygon.          Add V0 of