I eventually came up with a reasonable model for the mechanism. But
along the way I was confused by Blender's order of transforms and
its display of materials.
My basic problem was that I was not considering exactly where the
object and the texture are located in what I will call "texture space".
Conceptually the object and texture are placed into texture space and
the surface of the object is colored according to where it intersects
the projected texture.
As a starting point for the texture mapping the object and the image are
made "the same size". The object's bounding box (a rectangular prism in
its local coordinates) is scaled in the X, Y, and Z directions to create
a cube one unit on a side. The cube with its distorted object is placed
in the first octant of the 3D texture space with its lower left front
corner at the origin and its upper right back corner at (+1,+1,+1). The
rectangular image is scaled in the X and Y directions to become a square
one unit on a side (usually making its pixels rectangular rather than
For a Flat projection the texture square is placed into the X-Y plane on
the bottom face of the object cube. The lower left-hand corner of the
image is at the origin and the upper right-hand corner is at (+1,+1,0).
Each pixel of the texture square projects as a perpendicular rod
(rectangular in cross-section) that extends parallel to the Z-axis
towards infinity in both the +Z and -Z directions.
The problem that arises with rotations is that the axes of rotation are
the texture space coordinate axes which pass through the texture space
origin, not the more convenient axes at the centers of the object and
texture. So if you want to rotate either the cube or the texture around
its central Z-axis you have to
- Translate its center to the texture space Z-axis.
- Perform the rotation around the texture space Z-axis.
- Translate the center back its original position.
With the Tube projection the image has been wrapped around a vertical
(parallel to the Z-axis) cylinder of irrelevant radius one unit high
centered on (0.5,0.5,0.5). Each pixel of the image projects
horizontally from the center of the cylinder outwards in an infinite
pie-shaped wedge one pixel high passing exactly through its rectangle on
the surface of the cylinder.
The Sphere projection wraps the image around a sphere of irrelevant
radius centered at (0.5,0.5,0.5). Each pixel of the image projects from
the center of the sphere outwards to pass exactly through its rectangle
or triangle on the surface of the sphere.
So rotating the object or the texture about the Z-axis without the extra
translations separates the projected texture and the object, grossly
distorting their intersection.
Order Of Transforms
The first diversion on the way to the texture mapping model was figuring
out the order in which Blender was executing the transforms from the
It turns out that within a Mapping node the transforms are essentially
performed right to left. The scaling is performed first. Then the
rotations are performed in Blender's default Euler XYZ order. Finally
any translations take place.
However the order in which the chain of Mapping nodes is applied depends
upon the choice of Texture vs. Point set in the Mapping nodes. (Assume
that all Mapping nodes use the same option and ignore Vector and Normal for
With the default Point selection the Mapping nodes describe how the
object is transformed in texture space while the image projection
remains fixed. The chain of Mapping nodes is applied left-to-right; the
leftmost Mapping node is applied first, and each Mapping node
transforms the result coming from the node on its left.
With Texture selected the Mapping nodes describe how the texture is
transformed in texture space while the object in its cube remains fixed.
The chain of Mapping nodes is applied right-to-left; the rightmost
Mapping node is applied first, and each mapping node effectively
transforms the result from the node on its right. (This is the effect,
not how it is actually implemented.)
Point and Texture chains create net transforms which move the object
cube and the texture relative to each other. Choosing between the two
approaches is a matter of convenience for the user.
Display Of Materials
The second diversion on the way to the texture mapping model involved
accurate display of the mapped texture.
The Preview display in the Material section of the Properties Editor is
your best friend. If you are doing transparency or texture mapping you
need to have it active.
It did not dawn on me for a while that the 3D View was lying to me about
materials. I naively assumed that if I set the 3D View's "Viewport
Shading" to Material I would see the actual material. In fact the only
way to guarantee that is to select Render from the "Method to
display/shade objects in the 3D View:" (Viewport Shading) list. The
limitation is perfectly understandable in terms of computation time;
using Render can be very slow so Material can be expected to compromise.
But one result is that an Image Texture node set for Clip will show in
the Material selection for the 3D View as if Repeat has been chosen.
That was confusing during the early tests.
The other limitation on the Material shading arises directly from
computational expense. The non-Rendered display methods for the 3D View
cannot display some materials (e.g., transparency) on any object.
And they cannot display any material on some objects (e.g., a meta).
Do not make assumptions about how Blender works without taking the
time to test those assumptions.