so in the program I'm trying to write (still, it's a mathematical question) I have a set of coordinates and angles (Euler angles) which represent the place and orientation of an object in space, relative to the global origin of (0,0,0). Those are (X,Y,Z,Roll,Pitch,Yaw). Getting a translation to a local coordinate system which has its origins at the represented place and orientation is easy enough. However, I just can't get the calculations/translation back to my original coordinates right. Earlier posts in this forum or other platforms did not yield any results.
I first translate my local coordinate system to the (X,Y,Z) position and then rotate it via the conventional rotation matrix (As seen in http://de.wikipedia.org/wiki/Eulersche_Winkel#Roll-Nick-Gier; sorry that it's in German, the English page doesn't let me link directly for some reason. The math is universal, though.) That's all working fine.
However, I now want to get back to the point of origin (0,0,0) of my global fixed coordinate system without leaving the local system. So I need a vector from the local coordinate system that always points back to the global origin, regardless of local orientation in space.
I tried to do so by transposing the matrix (since rotation matrices are orthogonal), multiplying the vector (1,1,1) to it and then retranslating via (-X,-Y,-Z). That is not working, unfortunately. I can't really tell if the resulting point in space is still fixed to the local coordinate system, though.
Simply retranslating without rotating doesn't work either (obviously).
Where am I going wrong? I hope I've stated my problem clearly and understandably enough.