Jump to content
  • Advertisement
  • entries
  • comments
  • views

1 Comment

Recommended Comments

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.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!