I've asked this question both at game SE and math SE, but the response were not so encouraging. So I reasked again, with a bit more of a twist.

I have a terrain, which is defined by mesh. And there are a lot of other polygonal faces scattered throughout the terrain, they can be located above, or below or cutting through the terrain. You can think of those faces as platforms.

A screenshot below should clarify what I mean. Despite looking smooth, all the mesh are actually consist of small elements (number> 10k) combined together, giving the false appearance of smoothness. The obvious disconnected area are platforms.

My question is, how can I generate the planes that connect between the platforms and other platforms/ terrain? Here are the rules to generate the series of sloped planes:

1. They could go up or down, depending on which direction will make them hit the terrain/neigbouring platform first.
2. The plane generation rule is that, the plane will start at the edge of a platform, and moving 45 degree upward/downward with respect to z axis for a certain length, then it will move 0 degree with respect to z axis for another certain length, and repeat. So it will be a series of piecemeal planes until at some points of the planes, obstacles are hit.
3. The algorithm should be focused on plane generation and plane generation alone; I don't want it to be tied to any renderer ( e.g, opengl and whatnot), I can render it myself.

In short, I want to generate a set of "planes" that is actually something like a flight of stairs or a piece of corrugated paper, leading up or down from one point in space until it makes contact with a given mesh

Sounds like a straight forward collision detection problem that are frequent in physics simulation, right? Is there any game/physics libraries that I can use to attack this problem?

Note that since I am not doing any animation, so frame-by-frame update and all those stuffs are not relevant to me; this is why I am hesitant to use existing game physics library like bullet. What is relevant to me is how to use existing libraries to generate those connecting planes according to the above rules.

Top