Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Design of Surfaces by "texture" with POV-Ray -
Deutsch Deutsch
Italiano Italiano
Français français

Home
- POV-Ray Tutorial

  Design of Surfaces
  - Colors and Textures
    Index

    texture Syntax
    Ready-made Textures
    Do-it-yourself Colors
    Patterns
    Patterns Lists
    Warps
    uv_mapping
    Mapping
    - Mapping Methods
    - color_map{ ... }
    - pigment_map{ ... }
    - texture_map{ ... }
    - normal_map{ ... }
    - average
    - material_map{ ... }
   > image_map{...}
    - image_map+gif 1
    - image_map+gif 2
    - image_map+gamma
    - bump_map{ ... }
    - transparency maps 1
    - transparency maps 2
    - transparency maps 3
    Superpositions

    Your own Textures
 
                                           

"image_map{ ... }" - Mapping Images on Surfaces


Example "image_map{...}":


Sample image_map 640x480

sphere{<0,0,0>, 1
   texture{
    pigment{
     // mapps an image on the xy plane
     // from <0,0,0> to <1,1,0>
     // (aspect ratio 1:1)
     image_map{ png "plasma3.png"
     // imagetype "file name" - Path + .tga etc.
     // accepted types of images:
     // gif, tga, iff, ppm, pgm, png, jpeg, tiff, sys
     map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
     interpolate 2
      // 0=none, 1=linear, 2=bilinear, 4=normalized distance
     once //
      }} // end of image_map, end of pigment
    finish { diffuse 0.9 phong 1}// end of finish
     scale 2 translate<-1,-1,0>} // end of texture
  translate<0.5,1.2,0>} // end of sphere  ------------------


If we want to project an image named "MyImage.jpg" with an aspect ratio of a height:width = 3:4 exactly onto a surface of the height (y direction) 0.90 and the width (x direction) 1.20 we have to scale the projected image accordingly:

Example:


Sample image_map 640x480

box{<0,0,0>, <1.20, 0.90,0.01>
     texture{ pigment { image_map{ gif "CGrafLo.gif"
                        map_type 0 interpolate 2 once }
                        scale <1.20,0.90,1> }
              finish  { diffuse 0.9 phong 1}}
     scale 2.5 rotate<0,W1,0> translate<-1.2,0.3,0>}
top

© Friedrich A. Lohmüller, 2010
www.f-lohmueller.de