Advertisement Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

In Stitches

Sign in to follow this  


Due to the triangle-soup nature of the levels, it can be a pain to use the triangles themselves as the main modeling primitive. In retrospect, I think a voxel-type approach would have been better, at least to rough things out. It could use marching tetrahedra to create tris to draw.

Anyway, the simple triangle extrusion model has been working well enough, and the plan is to use it to rough out the levels and get them playable, then hand them over to the real artists to pretty-up.

One of the issues with the level editor is the difficulty in closing holes, and creating geometry between things, so I did a geometry stitching tool.

Just now I got it working in all of my test cases, and it's pretty good.

What you do is to pass in a set of unordered selected vertices. It puts them in a consistent winding order, and verifies it's convex. If not, it punts. I need to add a planarity check as well - not sure what it would do in that case...

Yesterday I stopped there, and output the convex polygon as a set of triangles from each edge to the poly center, which worked ok, but made the resulting polys useless for further editing, which really likes a nice grid to work with.

So, I added an extra step to go through and clip the resulting poly down to quads and such based on one-meter-apart clipping planes.

I wonder how many clippers I've written, and why I always end up writing another one, rather than re-using one, often due to the slightly different requirements. For instance, if your clipper outputs tris directly, it can more easily find degenerate polys, by checking vertices < 3. Sometimes you want front & back sides output, sometimes just front.

Anyway, after tracking down the 87th backwards lerp parameter bug in my life, I got it working. It now creates a nicely tessellated bunch of tris between the selected verts.

This allows you to fill convex holes, create ramps, ramp sides, etc. very quickly.

Here is a ramp that I made with 3 runs of the stitch tool.

Sign in to follow this  


Recommended Comments

There are no comments to display.

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, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!