Hello,
I’m totally confused with is supposed to be the most basic thing.
So I have a polygon, that draw on the screen.
I have a variable scale and then I need to center it on the screen.
ofPushMatrix()
ofTranslate(-polygonCenterX, -polygonCenterY);
ofPushMatrix()
ofScale(scaleValue);
ofTranslate(blah,blah to center);
for (unsigned int i = 0; i < blobs.size(); i++) {
tess.tessellateToMesh(blobs[i], ofPolyWindingMode::OF_POLY_WINDING_ODD, theMesh, true);
theMesh.draw();
ofPopMatrix();
ofPopMatrix();
I would expect ofTranslate to moves the origin of coordinate system.
Then scale is supposed … well scale and stay at zero.
However when I scale it moves away from zero proportionally to scale.
Need some crazy calculations to bring it back… that doesn’t seems right.
if I do
ofPushMatrix();
ofTranslate(-polygonCenterX, -polygonCenterY);
ofScale(scaleValue);
the effect is the same… when I scale my mesh moves away!
What am I doing wrong, I don’t understand. I’ve spent hours…
SOS!