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
    - pattern types
      Regular patterns
    - checker, hexagon
    - square, triangular
    - brick
   > object pattern (1)
    - object pattern (2)
    - object pattern (3)
    - tiling
    - pavement
      Stripe Patterns
    - color_map{...}
      Patterns by pigments
    - pigment_pattern (1)
    - pigment_pattern (2)
    Patterns Lists
    - Regular Patterns
    - Random Patterns
    - Fractal Patterns
    - Other Patterns
    Warps
    - warp mapping
    uv_mapping
    Mapping
    Superpositions

    Your own Textures
 
                                             
  Object Pattern (1)
Syntax:
object{
  OBJECT_IDENTIFIER | OBJECT {}
  LIST_Outside, LIST_Inside
  }
This block pattern cannot use color_map, wave types or slope_map modifiers.
OBJECT = solid object without texture.
The following lists contains what this pattern controls.
This may be colors, pigments, textures, normals, etc. ...
LIST_Outside = assigned to points outside of the OBJECT.
LIST_Inside = assigned to points inside of the OBJECT.
Example 1: Object pattern applied on colors
// object for object pattern
#declare Pattern_Object_1=
union{
  object{
   Round_Box(<-10,-.5,-3>,<0,1.3,-.5>,.4,0)}
  object{
   Round_Box(<-10,-.5,.5>,<0,1.3,3.0>,.4,0)}
} // end of union
//-------------------------------------------
#declare Object_Pigment_1 =
pigment{
  object{
      Pattern_Object_1
      color rgb<1,0.65,0.2> // outside
      color rgb<0.6,0.00,0>  // inside
    }// object
} // end pigment
//-------------------------------------------
#declare Body_Texture =
   texture{ pigment{ Object_Pigment_1 }
            finish { phong 1 }
          } // end of texture
//-------------------------------------------
#declare D = 0.00001;
#declare W = 0.75;// width
#declare Sz = 3; // z scale
#declare H  = 3; // height
union{ // Body
  object{ Round_Box(<-3,0,-W>,<0,H,W>,W-D,0)
          matrix<1, 0, 0, // shear_y_to_x
                 -0.5, 1, 0,
                    0, 0, 1,
                    0, 0, 0>} //
  object{ Round_Box(<-5,0,-W>,<0,H,W>,W-D,0)
          translate<-2,0,0>} //
  scale<1,1,Sz>
  texture{ Body_Texture }
} //-----------------------------------------

Object for Object Pattern
We have to decide, which part of the space
shall be filled by the inside color and make sure that the
pattern object hits the body surface at the right places.

Object Pattern
The object pattern applied to the body.
POV-Ray scene file: Object_Pattern_100.pov

Example 2: Object pattern with 3 colors
//-------------------------------------------
#declare Body_Texture_1 =
   texture{ pigment{ Object_Pigment_1 }
            finish { phong 1 }
          }
//-------------------------------------------
// another object for an object pattern
#declare Pattern_Object_2=
  box{<-10,2.25,-3>,<0,3,3>}
//-------------------------------------------
#declare Object_Pigment_2 =
pigment{
   object {
    Pattern_Object_2
    color rgbf<1,1,1,1> // outside
    color rgb<1,1,1>*0.05// inside
   }// object
  } // end pigment
//-------------------------------------------
#declare Body_Texture_2 =
   texture{ pigment{ Object_Pigment_2 }
            finish { phong 1 }
          }
//-------------------------------------------
// layered texture:
#declare Body_Texture =
 texture{ Body_Texture_1 }
 texture{ Body_Texture_2 }
//-------------------------------------------

Object Pattern 3 colors
The object pattern with 3 colors
POV-Ray scene file: Object_Pattern_150.pov

Example 3: Object pattern applied on pigment and normal
//-------------------------------------------
#declare Object_Normal_1 =
normal{
   object {
    Pattern_Object_1
    normal{ agate 2 scale 0.15  } // outside
    normal{ bumps 0.35 scale 0.15} // inside
   }// object
  } // end normal
//-------------------------------------------
//-------------------------------------------
#declare Body_Texture =
   texture{ pigment{ Object_Pigment_1 }
            normal { Object_Normal_1 }
            finish { phong 1 }
          }
//-------------------------------------------

Object for Object Pattern
The object pattern applied on pigment and normal
POV-Ray scene file: Object_Pattern_100.pov
top

© Friedrich A. Lohmüller, 2012
http://www.f-lohmueller.de