0
\$\begingroup\$

I am struggling to understand the relationship between model transformation, model space, and world space.

I understand that model transformation transforms an object from model space into world space.

Consider the usual ordering when it comes to transformations (SRT). Assume the world space is given by (x, y, z) and the model space is given by (u, v, w). Then, here is my initial guess.

  1. Scaling happens in model space since scaling does not change the direction of the vector.
  2. Rotation is the step that aligns (u, v, w) to (x, y, z). I don't know what space this transformation occurs in. Rotating an object around its center point in world space / rotating an object around its center point in model space all seem plausible to me.
  3. Translation happens in world space since now (u, v, w) is aligned with (x, y, z).

What should be the correct way of thinking about this.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Model space is the name of the space you are in before you have applied any of S, R, or T.

World space is the name of the space you are in after you have applied all of S, R, and T.

We don't generally name the spaces for each step of the transformation between the two. Often, all three are concatenated into one matrix M = T * R * S, so we're not applying them as individual steps at all but all at once, and a vector never exists in an intermediate space:

p_world = M * p_model

A "space" is not just the direction of its basis vectors, but also its scaling and absolute position / "reference zero". So we can't really say the vector is in either model ot world space when we've applied some of these steps but not all of them.

What we can say is...

  • The first three diagonal components of the S matrix (S[0,0], S[1,1] and S[2,2]) are the scale factors to apply to the model's u, v, and w axes, respectively.

    The result could be called "scaled model space"

  • The first three columns of the R matrix are the unit direction vectors in world space that you want the model's u, v, and w axes to point along after rotation. This rotation does not change the location of the model's origin (the point u = v = w = 0) — we pivot around this origin point.

    The result could be called "scaled and rotated model space" or "unshifted world space" since it does not incorporate translation yet.

  • The last column of the T matrix is point in world space where you want the model's pivot/origin to move to, after rotation.

Does that answer what you needed to know?

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .