============================= Materials/Textures -- mapping ============================= .. index:: .. |a| image:: /images/all/blender-basics/h_material/uv-cube-100.png Objectives ========== .. tabularcolumns:: | c | l | :border: none +-------+-------------------------------------------------------------------------+ | |a| | Mapping is a common method to put pictures on objects. With simple | | | objects it is possible to use a script. This is demonstrated in this | | | station. Move the final cube to see all pictures applied. | | | How to animate the cube is shown in an other station. | +-------+-------------------------------------------------------------------------+ Instructions ============ :Tasks: 1. Start the functions and have a look to the resulting output. 2. Replace the images with your own. 3. Alter the code, let one face empty. Sample images ============= :download:`Download (pictures_uv_mapping.zip) ` Putting images (2D) on a body (3D) is named UV-Mapping. The letters U and V are used, because X, Y and Z always used for positioning an object in a 3D-World. Like materials textures are managed independent form any object. Textures are also never directly connected to an object, instead a material is used. So wie have a chain: texture » material » body. In our first example a picture is placed on one site of a cube: .. image:: /images/all/blender-basics/h_material/pymove3d-rendered.jpg | The second example is showing different images on all faces of a cube: .. image:: /images/all/blender-basics/h_material/six-images.png | Have I heard the term »Mindcraft« (hava a look at exercise tree): .. image:: /images/all/blender-basics/h_material/minecraft.png One image on all faces ====================== .. literalinclude:: files/mat1.py :language: python One image on each Face ====================== .. literalinclude:: files/mat2.py :language: python