File: mapping.rst

package info (click to toggle)
blender-doc 4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 253,604 kB
  • sloc: python: 13,030; javascript: 322; makefile: 113; sh: 107
file content (86 lines) | stat: -rw-r--r-- 2,979 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.. _bpy.types.ShaderNodeMapping:

************
Mapping Node
************

The *Mapping* node transforms the input vector by applying translation, rotation, and scaling.

.. figure:: /images/node-types_ShaderNodeMapping.webp
   :alt: Mapping node.


Inputs
======

The inputs of the node are dynamic. In particular, the *Location* input is only available in
the *Texture* and *Point* vector types.

Vector
   The vector to be transformed.

Location
   The amount of translation along each axis.

Rotation
   The amount of rotation along each axis. XYZ order.

Scale
   The amount of scaling along each axis.


Properties
==========

Vector Type
   The node applies the transformation differently depending on the semantic type of the input vector.

   :Point:
      For this vector type, the node performs a straightforward transformation.

      Transforming a texture coordinates is analogous to transforming a UV map.
      For instance, translating the texture coordinates along the **positive** X axis would result
      in the evaluated texture to move in the **negative** X axis, much like if one translated a UV map.
      Similarly, scaling the texture coordinates **up** would result in the evaluated texture to scale **down**.
      So transforming the texture coordinates would appear to have the opposite effect on the evaluated texture.

      The order of transformation is: Scale --> Rotate --> Translate, which means:

      - Translation moves the input along the local rotation axis.
      - Rotation rotates the input around the origin of the space.
      - Scaling scales the input along the global axis.
   :Texture:
      For this vector type, the node performs an inverse transformation.

      Inverse transforming a texture coordinates would, as opposed to the *Point* type,
      transform the evaluated texture itself. For instance, translating the texture coordinates along
      the positive X axis would result in the evaluated texture to move in the positive X axis,
      as one would expected. Similarly, scaling the texture coordinates up would result in
      the evaluated texture to scale up, as one would expect.

      The order of transformation is: Translate --> Rotate --> Scale, which means:

      - Translation moves the input along the global axis.
      - Rotation rotates the input around the translation vector.
      - Scaling scales the input along the local rotation axis.
   :Vector:
      For this vector type, a *Point* transformation is performed, but with zero translation.
   :Normal:
      For this vector type, the node performs the inverse transpose of the transformation and normalize the result.
      Such transformation ensures correct normals after non-uniform scaling.
      So this type should be used when transforming normals.


Outputs
=======

Vector
   The input vector after transformation.


Examples
========

.. figure:: /images/render_shader-nodes_vector_mapping_example.png

   Mapping node example.