I am reading this lesson from scratchapixel. To my understanding (and the example given in the same website) M is the matrix that transforms from local to world.
Giong through the paragraph before figure 7, though, I get the following:
If we know the 4x4 matrix M that transforms a coordinate system A into a coordinate system B ...
Say A is the local coord system and B is the world coord system. Therefore M transforms from local to world.
... then if we transform a point whose coordinates are originally defined with respect to A with the inverse of M (...), we get the coordinates of P with respect to B.
We know, A = local coord system. The Plocal = local point coords are (-0.5, 0.5, -0.5). Then, as the quoted text says, we transform Plocal with the inverse of M to get the point w.r.t. to B = woorld coord system
However, this last operation (statement) confuses me, since the example they give the do Pworld = Plocal * M. But from the quoted text I understand that Pworld = inv(M) * Plocal
Can someone help me figuring out what am I missing? Is the wording of the text wrong?
M
transforms from local to world, thenpLocal * M = pWorld
andpWorld * inv(M) = pLocal
. These are the formulas stated on the page you linked. \$\endgroup\$Pworld = Plocal * M
which is ok to me. However, the text quoted, seems (at least for me) sayingPworld = Plocal * inv(M)
, i.e. "If we transform a point P whose coords are defined w.r.t. to local-coord system with the inverse of M, we get the coords of P w.r.t. world-coord system" or paraphrasing "A point P in local-coord system, transformed with the inverse of M, gives the point P in woord-coord system". I think it should be "A point P in local-coord sys, transformed with M, gives the point P in woord-coord sys" \$\endgroup\$But how do we convert a point or vertex from one coordinate system (such as the world coordinate space) to another [...]?
This part seems to imply that in that paragraph, they inverted A and B so that A is world coordinates and B is local coordinates, to show how to convert world position to local position. \$\endgroup\$