TriMesh2

Code DiveTime for a quick update. Last week, we decided to focus on the two papers which I found the most interesting: Suggestive Contours and Exaggerated Shading.

It was time to cook up an OpenGL up to display contours, and later on suggestive contours. This implied I had to get started with C++/OpenGL. I started out with a regular text editor, but moved to Eclipse for C++ rather quickly.

I had a look at Trimesh2 to use in my implementation, and started exploring the Mesh Viewer example which came with the libraries. Since there’s no online documentation, it’s taking me a while to figure out all the nuts and bolts of the provided classes, by looking at the header and source files themselves.

It also took a while for me to find out that I had to compile with -fopenmp, which seems to be some kind of threading library Trimesh2 is using heavily.

The provided TriMesh class itself is very feature-rich. All the computations are implemented using need_(something, for example normals) functions, so you only compute when the data which is actually needed.

I experimented a bit with the Mesh Viewer settings, and there is a function to draw the triangle strips and show the wireframe:

bunny_triangles

Now, I’m looking into integrating some of the provided example shaders, and getting more more in grip with the library, the tools and the C++ language itself …

Leave a Reply