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

Home
- POV-Ray Tutorial

  Coordinate Systems
  and 2D Functions

  > Squared Paper
  - Coordinate Systems
      with Axes
  - Macro for Grids
      with 2 Levels
  - 2D Functions
      Samples
  - Math Functions
      in POV-Ray
                                           

Grid Plane - Squared Paper

The Construction of a Grid Pane by 3 layered Textures.

Objects:    "plane".
Methods: "color_map, layered textures, macro"

Construction in Details:

Two lattice grilles, each of them realized by a color_map
(thin dark opac + wide clear transparent),
with one of them rotated by 90 degrees, are layered
together with a white background.

// ------------------<<< Raster macro
#macro Raster(RScale, RLine)
pigment{
   gradient x scale RScale
   color_map{
     [0.000   color rgb<1,1,1>*0.5]
     [0+RLine color rgb<1,1,1>*0.5]
     [0+RLine color rgbt<1,1,1,1>]
     [1-RLine color rgbt<1,1,1,1>]
     [1-RLine color rgb<1,1,1>*0.5]
     [1.000   color rgb<1,1,1>*0.5]
            }
       } // end of pigment
#end// of "Raster(RScale, RLine)"

// -------------------<<<< Grid macro
#macro Grid(RasterScale,
            RasterHalfLine,
            Background_pigment)
plane{<0,1,0>, 0
       //layered textures!!!!
      texture{ Background_pigment
             } //  base color
      texture{ Raster(RasterScale,
                      RasterHalfLine)
             } // 2nd layer
      texture{ Raster(RasterScale,
                      RasterHalfLine)
               rotate<0,90,0>
             } // 3rd layer
     } // end of plane
#end // end of macro "Grid(...)"
// -----------------------------------
// use it:
object{Grid(0.50,0.035,
   pigment{color rgb<1,1,1>*1.1})}
// ------------------------- end -----


'layered textures':
Sample layered grids 320x240
Another view of the grid plane:
Sample grid 320x240
Scene description for POV-Ray: grid01.pov

top

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