Order of Matrix multipliation and its effect on transformations

One thing that I stuggle regularily with, is the order in which matrices should be multiplied to achieve a specific result. So I decided to get this clear for myself for good and all.

As you know, matrices (at least in our context of 3D graphics) represent transformations. Multiple transformation matrices can be combined using marix multiplication. But since this operation is not commutative, the order of the multiplication is important.

Since matrices represent transformations, they build new coordinate systems, too: These new systems are defined by axis vectors that have been transformed using the matrix. An example will clarify this fact:

In the examples used in this post, I will use a rotation matrix around 30 degrees, because \sin(30^\circ) = \frac{1}{2} and \cos(30^\circ) = \sqrt{\frac{3}{4}}, which is easy to write down and we still stay exact when calculating with it.

Part 1: A single transformation matrix

Given the origin system with the axis vectors \left(\begin{array}{c}1 \\ 0 \\ 0 \end{array}\right) and \left(\begin{array}{c}0 \\ 1 \\ 0 \end{array}\right), when we rotate these vectors around 30 degrees, we get the vectors \left(\begin{array}{c}\sqrt{\frac{3}{4}} \\ \frac{1}{2} \\ 0 \end{array}\right) and \left(\begin{array}{c}-\frac{1}{2} \\ \sqrt{\frac{3}{4}} \\ 0 \end{array}\right)
Continue reading

Skinning Part 1

Skinning is a technique to animate 3D models. The principle is related to reality where bones are moved by muscles and therefore moving the skin covering the body. In 3D graphics, we don’t need the muscles – we just animate the bones and since the mesh, which is the skin in this case, is attached to the bones, it moves and acts as the bones move:

The principle of skinning

The principle of skinning

Continue reading

Vektorrechnung

Vektoren sind das grundlegenste Element in der 3D-Grafik. Mit ihnen werden Richtungen und Punkte im 3D-Raum festgelegt. Ein Vektor bestimmt eigentlich nur eine bestimmte Strecke im Raum ohne Ursprung und daher kann man einen Vektor beliebig verschieben ohne dass es sich danach um einen anderen Vektor handelt. Man stellt sich einen Vektor üblicherweise als einen Pfeil vor den man nicht drehen aber beliebig verschieben kann.

Identische Vektoren

Identische Vektoren

Möchte man einen bestimmten Punkt im Raum mit einem Vektor definieren, so legt man fest, dass der Ursprung des Vektors der Ursprung des Koordinatensystems ist (=(0,0,0)). Diese Vektoren nennt man dann Ortsvektoren und schreibt sie mit einem großen Buchstaben mit Pfeil darüber, im Gegensatz zu den Richtungsvektoren die mit Kleinbuchstaben geschrieben werden.

\vec v = \left( \begin{array}{c} v_{x} \\ v_{y} \\ v_{z} \\ v_{t} \end{array} \right)

Continue reading