I am working with one of the camera ribbon examples from OpenFrameworks and I’m trying to figure out a way to remove all vectors or points after a specific amount of time.

What would be the best way to write the if statement for that?

void ofApp::draw(){
ofMesh mesh;
mesh.setMode(OF_PRIMITIVE_TRIANGLE_STRIP);
for(unsigned int i = 1; i < points.size(); i++){
//find this point and the next point
ofVec3f thisPoint = points[i-1];
ofVec3f nextPoint = points[i];
//get the direction from one to the next.
//the ribbon should fan out from this direction
ofVec3f direction = (nextPoint - thisPoint);
//get the distance from one point to the next
float distance = direction.length();
//get the normalized direction. normalized vectors always have a length of one
//and are really useful for representing directions as opposed to something with length
ofVec3f unitDirection = direction.normalized();
//find both directions to the left and to the right
ofVec3f toTheLeft = unitDirection.getRotated(-90, ofVec3f(0,0,1));
ofVec3f toTheRight = unitDirection.getRotated(90, ofVec3f(0,0,1));
//use the map function to determine the distance.
//the longer the distance, the narrower the line.
//this makes it look a bit like brush strokes
float thickness = ofMap(distance, 0, 60, 20, 2, true);
//calculate the points to the left and to the right
//by extending the current point in the direction of left/right by the length
ofVec3f leftPoint = thisPoint+toTheLeft*thickness;
ofVec3f rightPoint = thisPoint+toTheRight*thickness;
//add these points to the triangle strip
mesh.addVertex(ofVec3f(leftPoint.x, leftPoint.y, leftPoint.z));
mesh.addVertex(ofVec3f(rightPoint.x, rightPoint.y, rightPoint.z));
}
//end the shape
mesh.draw();
}