Reply To: Why are two “Mapping Nodes” in Sequence needed for Volumetric Tunnel?

Forum Archive Why are two “Mapping Nodes” in Sequence needed for Volumetric Tunnel? Reply To: Why are two “Mapping Nodes” in Sequence needed for Volumetric Tunnel?

#62563
spikeyxxx
Participant

    Yes @duerer I was afraid that I wasn’t clear 😉  

    I am also not familiar with the source code btw.

    Important is the fact that it is not the Mapping Node that is causing troubles in my example with the scaled sphere.

    Let’s first focus on the Mapping Node. 

    When using the Point setting, each point in 3D space is being transformed by scaling (call this S) rotating (let’s call this R) and translating (moving, let’s call this T). A point P in space is then transformed into: T(R(S(P))). Scale the point (/vector), then rotate it and then translate it.

    Some numbers:

    let P be (x, y, z), then scaling by (3, 2, 1) will transform this into S(P): (3x, 2y, z). Followed by a rotation of 90° around the Y-axis will transform this into R(S(P)): (z, 2y, 3x). Translating it then by (1, 0, 0) will transform this point into T(R(S(P))): (z+1, 2y, 3x).

    Now we plug the Mapping Node with these transforms into a Texture Node. Whatever color this texture has at (z+1, 2y, 3x) will be put at (x, y, z).

    Now let’s try and get that same effect with the Mapping Node set to Texture.

    So, we want the point (z+1, 2y, 3x) of the texture to go to point (x, y, z) of the coordinate system. We do this by inverting the transforms and inverting the order (this is sometimes called the socks and shoes theorem):

    We get: S`(R`(T`(P))). 

    Recall that:P is (z+1, 2y, 3x), so T`(P) is (z, 2y, 3x). R`(T`(P)) becomes (3x, 2y, z) and (scaling by (1/3, 1/2, 1)) will gives us: S'(R'(t'(P))) which is (x, y, z).

    Does this make any sense to you now?