I have an object at (0,0,0) whose pivot point I moved to an arbitrary location. I then rotated or scaled it to an arbitrary value. My initial modelMatrix is:
rotationM = glm::toMat4(glm::quat(glm::radians(r->val_3)));
pivAxis1M = glm::translate(glm::mat4(), -pivot->val_3);
pivAxis2M = glm::translate(glm::mat4(), pivot->val_3);
modelM = translationM * pivOffset1M * rotationM * scaleM * pivOffset1M;
I want to center the pivot of the object so the pivot point is at the logical spot aka transformed bounding box center while keeping every attribute on the object that’s visible to the user the same AND keeping the object in the same place / rotation / scale - like they do in every 3d app. I have only been successful when my rotation and scale values are zero, but that is unacceptable.