I am trying to scale a ofMesh using as anchor point its centroid.
The mesh has a video as texture and it is not a regular shape.
I have initially tried to use
pushMAtrix() ofScale() and ofTransalte()
float scalefactor = 1; ofPushMatrix(); ofTranslate(-centroid); ofScale(scalefactor,scalefactor); video.getTextureReference().bind(); mesh.draw(); video.getTextureReference().unbind(); ofPopMatrix();
however it doesn’t keep the anchor point centred.
I then tried to multiply each vertex * the scale factor but the result was similar.
Also for some reason if the scalefactor is = 2 I get a more centred result than if it is 1.
I think I am missing some basic here…
Is anyone able to help me with this please?