0
\$\begingroup\$

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?

\$\endgroup\$

2 Answers 2

0
\$\begingroup\$

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;
\$\endgroup\$
2
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.