ofxStrip - animate taper (change ofPolygon first vertex)

Hello,

I’m using ofxStrip to draw a stroke around the shape. I use taper as well and I would like to animate this taper. I think for that I need to re-number the vertexes inside the ofPolygon ? Is there a way to assign vertex[0] to 1…etc all the way around ?

Thanks
M

Hi, just “manually” modify it the vertices vector. There is no thing as an ofPolygon, maybe you meant ofPolyline?
Something like the following should work

//ofPolyline poly;
auto& verts = poly.getVertices();
if(verts.size()>1){
    auto last = verts.back();
    for(size_t i = verts.size() -1; i > 0; i--){
        verts[i] = verts[i-1];
    }
}
verts[0] = last;
1 Like