Two opinions

Published August 22, 2007
Advertisement
1) This is a pretty good film.

2) Constraining polygons to convex while they are being defined by the mouse is very very difficult.
Previous Entry Tired but happy
Next Entry Convex polygon hell
0 likes 1 comments

Comments

benryves
I developed a little polygon-based map editor, where you'd insert vertices then connect the dots with the mouse.

As you dragged vertices around it would find all of the other vertices in your current polygon (by following your hand-drawn links). It would remove the links between then, then reorder the list of vertices into a convex polygon (if I remember correctly, I simply went around in a clockwise direction using the midpoint of the polygon as a reference point). Once this was done, I'd join them all back together.

This could look a bit odd if you, say, grabbed a corner of a square and dragged this through the polygon, as the shape would suddenly changed once it became concave.
August 23, 2007 11:18 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement