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{ ... }" II   - with Transparent Gif Images

Example:


gif image
palette image (gif)
with 256 colors
with transparent background.
background = index 215
  +  
gif image
object{ Golf_Ball }
  =  
gif image
object{ POV_Ball } ???

A sphere with a layered textures:
sphere{ <0,0,0>, 0.5
        texture{ pigment{ color rgb<1, 1,1>}
                 normal{ leopard -5 scale 0.015}
                 finish { diffuse 0.9 phong 0.1}
               } // end of texture 1

        texture{ pigment{
                 image_map{ gif "POV-Ray_215.gif"
                            map_type 0
                            once
                            transmit 215, 1
                          }
                 translate<-0.5,-0.5,0>
                 scale<0.75,1,1>*0.85
                 } // end pigment
                 normal{ leopard -5 scale 0.015}
               } // end of texture 2
  } // end of sphere  ------------------
   
Lohmi...!
We have ...
image_map
... an image_map problem !


A possible solution of this problem:
For this we have to spitt the object in two parts: frontside and backside.

//------------------------
#declare Hemisphere =
intersection {
 sphere { <0,0,0>, 1}
 box{ <-1,-1,-1>,<1,1,0>}
} // end of intersection
//------------------------
   
gif image
   
gif image

Now we put textures on the frontside and backside separately:

union{
object{ Hemisphere scale 0.5  // frontside
        texture{ pigment{ color rgb<1, 1,1>}
                 normal{ leopard -5 scale 0.015}
                 finish { diffuse 0.9 phong 0.1}
               } // end of texture 1
        texture{ pigment{
                 image_map{ gif "POV-Ray_215.gif"
                            map_type 0
                            once
                            transmit 215, 1
                          }
                 translate<-0.5,-0.5,0>
                 scale<0.75,1,1>*0.95
                 } // end pigment
                 normal{ leopard -5 scale 0.015}
               } // end of texture 2
         rotate<0,0,0>
      } // end of Hemisphere -------------------------
object{ Hemisphere scale 0.5  // backside
        texture{ pigment{ color rgb<1, 1,1>}
                 normal{ leopard -5 scale 0.015}
                 finish { diffuse 0.9 phong 0.1}
               } // end of texture 1
        texture{ pigment{
                 image_map{ gif "POV-Ray_215.gif"
                            map_type 0
                            once
                            transmit 215, 1
                          }
                 translate<-0.5,-0.5,0>
                 scale<0.75,1,1>*0.95
                 } // end pigment
                 normal{ leopard -5 scale 0.015}
               } // end of texture 2
         rotate<0,180,0>
      } // end of Hemisphere -------------------------
//scale 0.04 // optional downsized to 4 centimeters
translate <0,0.5,0>
rotate <0,60,0>
} // end of union "Golf_Ball" --------------

   
gif image
Frontside
   
gif image
Backside
   
gif image
golf ball
top

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