Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
M.Translate(translationVector);

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

share|improve this question
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.