Drawing wireframe of ofMesh as tubes

I have an ofMesh that I would like to draw as a wireframe but I would like the wireframe to have some thickness (tubes, cylinders…), as in the picture below.

Any hints?

In drawing tubes, I’ve had success with ofxPTF. For this to work, you’d need to find specific paths in your ofMesh that you want to follow. You could then iterate through each point in that path and add it to the PTF object. This will at least give you easy access to drawing rings around the “rail” or "path that you are building the tubes from.

Might be a good place to start. I’ve found that drawing small examples (fewer points) helps to understand how it works.

Or if you want to dig into a Java library, you could check out how Processing’s HE_Mesh library does it. See the Ref_HEM_Lattice example:

It would be cool to port HE_Mesh to C++ :slight_smile:

About the topic shaders&wireframes geometries, I would suggest to have a look at this repository by Matt Des Lauriers

Here some examples


1 Like