ofPolyline getPointAtPercent problem

I’m still learning OF and I can’t work this out. If I write the code below I would expect to get 6 circles drawn but it seems that getPointAtPercent goes up to 0.9999 but not 1.0. Is that right and if so how can I get the final point on the polyline i.e. at percentile 1.0?

ofPolyline p;
p.curveTo(200, 200);
p.curveTo(250, 400);
p.curveTo(500, 200);
p.curveTo(1200, 900);
p.draw();
for(int i = 0; i <= 5; i++){
ofVec3f temp1 = p.getPointAtPercent(i / 5.);
ofCircle(temp1.x, temp1.y, 5);
}

PMc

Hi there! When using the most recent release, you do, in fact, get that issue. With the master branch, it’s fine. So, you are not crazy. :slight_smile:

thanks Hubris, I’m not clear about the master branch - are you saying that I should download a previous version of OF direct from github?

The master branch on Github (which you can clone or download as a Zip) is the version that the team is currently working on. It can be not as stable as the release, but it does have the latests improvements. I also keep a few previous versions, just in case. But generally, I like to work with the master branch.

Hope this helps, good work.

Okey doke Thanks