Draw all vertices ofPath as points?

Hi all,

Is there an easy way to draw all the vertices of an ofPath as points? I know I can extract them as ofPolyLines and then get the vertices or as a mesh but maybe there is a simpler way?

Also, in OF if I have a vector of 2D points what is the most efficient way to render them just as points? Do they also need to be also passed to an ofMesh?

thanks

in both cases an ofMesh (or even better an ofVboMesh) would be the most efficient.

for the first case yes extracting the polyline or the ofMesh is the only way, ofPath is kind of a high level class so it doesn’t allow to go directly through it’s points since they are stored as commands like line, bezier… rather than the decomposition in vertices.

would you suggest to use ofMesh instead of ofPath or ofPolyline for drawing beziers between points too ?

no, ofMesh doesn’t have any method to draw beziers or anything really is just a container for vertex data. if you want to draw bezier or any other simple primitives the easiest is to use ofPath. later you can get the final mesh using getTessellation if you need to manipulate the vertices somehow

Ok thanks I got it