# Transform point while keeping other points offset

I have the following situation: I've got a box with its center of mass transform matrix that I'm obtaining from physics simulation, i.e. it keeps changing with time. I've also got two points (actually two transformation matrices) which are static (the simulation doesn't calculate them, neither do I want it to) that I want to 'keep in sync' with the original state (t=0 in the picture).

Any ideas how do I calculate the other two matrices when the center of mass changes, while keeping their original offsets satisfied?

I'm using jBullet for physics.

As long as the transformation applied to the center of mass is only composed of rotation and translation (given that it comes from a physics simulation that should be true), that same transformation applied to your two non-simulated points will put them in the same relative position at t = 0.25 as they were in at t = 0.
Most physics engines provide a way for you to get the world transform of a given body's center of mass, either in matrix form or as separate translation and rotation components. For jBullet, that would be the getCenterOfMassTransform function.
Construct two Transform objects for both of your non-simulated points in their original position. Then use the mul method of Transform to multiply your non-simulated point transforms by the rigid body's transformation to bring your non-simulated points into the same relative orientation and position as the new center of mass.