Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I have a terrain mesh of some triangles, and several smaller meshes which I want to add to that terrain mesh (think ground and some small mounds or berms for example). What would I look for to find algorithms to let me do this? I know it's like some kind of computational geometry but I wonder if anyone might know search terms or even better urls to look at. Ideally I would like to do this on the fly to simplify drawing of a terrain where the basic ground and the detailed "interesting" bits are stored separately. Right now we draw the ground and the other parts separately which is less than ideal.

share|improve this question
What's wrong with just sticking your detail meshes at the end of the mesh data and connecting them with a degenerate triangle or two? – Tetrad Jul 20 '11 at 20:01
Overlaps are possible. – ahwulf Jul 20 '11 at 20:14
When you say overlaps what do you mean? Like visual problems? It shouldn't look any different than just drawing thing separately. I wouldn't recommend taking a heightmap-style terrain and physically cutting it up to insert details. You'd get a lot more triangles out of the end result when you could just doing a naive batch and eat the overdraw. – Tetrad Jul 20 '11 at 20:22
I think he's looking to 'merge' terrain features into the terrain mesh, so there's no 'visible' separation. Which would be very difficult, high processing cost and you'd have a tricky time with texturing. – dcousens Jul 21 '11 at 3:22
This is why we place doodads right? That's how most games does it at least. – Nailer Jul 21 '11 at 13:25

I think the term you are look for is CSG, or constructive solid geometry. There are basically three different operations: boolean union, boolean intersection, and boolean difference. You need the boolean union to merge two overlapping meshes into one. I'm sure you'll be able find some useful information with those terms.

Some links to get you started:

share|improve this answer
I'll take a look, thanks. I also thought later than one could do a delauney triangulation on all the points, then re-add the height values. I think this might work since this is terrain type things I am merging. – ahwulf Jul 21 '11 at 16:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.