Descriptions and Samples for the POV-Ray Raytracer by Friedrich A. Lohmüller
Français français
Deutsch Deutsch

"material_map" textures layered textures

Surface Design by "texture"

Mapping images on surfaces: "image_map{ ... }"


// Sample of "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{ gif "plasma3.gif"
     // 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 {ambient 0.15 diffuse 0.85 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.tga" 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:

// sample:


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  { ambient 0.1 diffuse 0.9 phong 1}}
     scale 2.5 rotate<0,W1,0> translate<-1.2,0.3,0>}

"material_map" textures layered textures

© Friedrich A. Lohmüller, 2005
email email: (legacy email redacted)
homepage:www.f-lohmueller.de