Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is common algorithm for translating a transform matrix relative to world space axis?
E.g. Matrix M is representing some local space.
When I want to translate M relative to it's own local axis, I just do it like

But what should I do when I want to translate same matrix but relatively to world space axis?

share|improve this question
up vote 0 down vote accepted

pseudo code:

Vector mLocation = (M.41, M.42,M.43);

mLocation += normalizedWorldAxis * distanceToMove;

M.41 = mLocation.x;
M.42 = mLocation.y;
M.43 = mLocation.z;
share|improve this answer

In general you do not translate transforms. You translate points which are usually represented by vectors.

If you're wondering how to generate a transformation that produces a translation relative to the world axis, then you should look into homogeneous coordinates.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.