POV-Ray : Newsgroups : povray.text.scene-files : Kaleido_Tiles (pattern macro) : Kaleido_Tiles (pattern macro) Server Time
28 Jul 2024 14:28:10 EDT (-0400)
  Kaleido_Tiles (pattern macro)  
From: SamuelT 
Date: 17 Mar 2000 01:38:16
Message: <38D1D580.EEBF1929@aol.com>
See povray.binaries.images to see a demo image.

This macro lets you #declare your own pigment to be tiled along on the x
and z axes. The pigment is reflected on 4 axes for each tile, creating a
kaleidoscopic effect. The macro may be placed wherever you use pigments
and normals. It should work for media as well.

Here's how you declare your own pigments. Place this before you use the
macro:

#declare K_Tex =
    function{
        pigment{
            pigment stuff here
        }
    }

Here's a generic object statement. 'Grout' is how big the lines in
between the tiles are. 0 is none, and 1 is a lot. The lines will affect
the declared pigment:

povray_object{
    pigment{
        Kaleido_Tiles ( Grout )
        color_map{ items } //color_map is encouraged
    }
}

//*******MACRO*******

#macro Kaleido_Tiles( K_Grout )

  #local K_Line_X=
  function{
   pigment{function x phase .5 triangle_wave
    color_map{[1-(K_Grout*2) rgb 0][1 rgb 1]}
   }
  }
 #local K_Line_Z=
  function{
   pigment{function z phase .5 triangle_wave
    color_map{[1-(K_Grout*2) rgb 0][1  rgb 1]}
   }
  }
 #local K_Lines=
  function{
   pigment{
    function (K_Line_X(x,0,z))&(K_Line_Z(x,0,z))
   }
  }
 function{
  pigment{
   function
   (
K_Tex(abs(cos(x*pi))|abs(cos(z*pi)),y,abs(cos(x*pi))&abs(cos(z*pi))) )&(
K_Lines )
  }
 }

#end


--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit the still unfinished isosurface tutorial:
http://members.aol.com/stbenge


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.