Kanpachi
Kanpachi

Reputation: 31

Near-uniform tessellation of a concave polygon for heightmaps

I am given the contour/boundary of a concave polygon which cannot have holes, and I need to apply a heightmap to it. To this end, I need to perform a near-uniform tessellation of the polygon like so:

.

How can I perform this tessellation? Ideally, the solution could parameterize the 'resolution' of the internal vertices to adjust the detail of the tessellation.

I'm using OpenSceneGraph, so if this is somehow possible using its built-in tessellation library that would be ideal, but I'm open to introducing an additional (hopefully lightweight) dependency if necessary.

Upvotes: 3

Views: 966

Answers (2)

Goodies
Goodies

Reputation: 2069

Very nice ! have you ever considered using a geometry shader for this ? DirectX 11 and OpenGL allow for "on the fly" tesselation using the GPU. It's 20-40 times faster, depending on your hardware.

My favorite starting point for VS2015/C# tesselated animation is

https://github.com/RobyDX/SharpDX_Demo/tree/master/SharpDXTutorial/Tutorial11

If you prefer C/C++ and OpenGL there are many examples too..

http://prideout.net/blog/?p=48

Some of mine, I sample a texture bitmap for the height. On the right, you see some artifacts caused by my small normal errors in my little triangles.. gotta work on that one :)

some of mine

Above mesh is 32x32 squares and has tesselation depth 7. Here you see the flattened mesh, showing depth 1 tesselation:

flattened mesh showing tesselation

Upvotes: 1

Kanpachi
Kanpachi

Reputation: 31

This question didn't attract a great deal of interest, but I achieved fairly good results using the difficult-to-Google Triangle library.

A quick preview of some results.

If I decided I wanted the triangulation to be strictly uniform on the interior of the polygon, I could probably provide Triangle with a set of vertices to further constrain the tessellation.

Upvotes: 0

Related Questions