POV-Ray Raytracer descriptions by Friedrich A. Lohmueller
    deutsche Version

grid box grids overview system of coordinates

Grid Plane

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),
are 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 rgbt<0,0,0,0>]
             [0+RLine color rgbt<0,0,0,0>]
             [0+RLine color rgbt<1,1,1,1>] 
             [1-RLine color rgbt<1,1,1,1>]
             [1-RLine color rgbt<0,0,0,0>]
             [1.000   color rgbt<0,0,0,0>]
            } 
       } // end of pigment 
finish {ambient 0.45
        diffuse 0.55
       } // end of finish
#end// of "Raster(RScale, RLine)"  

// -----------------------<<<< Grid macro
#macro Grid(RasterScale,
            RasterHalfLine,
            Background_pigment)
plane{<0,1,0>, 0
       //layered textures!!!!
      texture{ Background_pigment 
               finish {ambient 0.45
                       diffuse 0.65}
             } // 1st layer - 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 -----
The resulting image:
Sample layered grids 320x240
Another view of the grid plane:
Sample grid 320x240
Click here for the complete scene description of the demo scene
for POV-Ray: ".txt" file or ".pov" file


grid box grids overview system of coordinates

© Friedrich A. Lohmüller, 2003     email email: (legacy email redacted)