POV-Ray : Newsgroups : povray.text.scene-files : Kaleido_Tiles (pattern macro) Server Time
1 Nov 2024 15:25:15 EDT (-0400)
  Kaleido_Tiles (pattern macro) (Message 1 to 3 of 3)  
From: SamuelT 
Subject: Kaleido_Tiles (pattern macro)
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

From: SamuelT 
Subject: Re: Kaleido_Tiles (pattern macro)
Date: 17 Mar 2000 01:52:02
Message: <38D1D8BC.678F06F1@aol.com>
Whoa, almost forgot: you have to have either the Superpatch or MegaPov to
use this macro... Enjoy!

--
Samuel Benge

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

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


Post a reply to this message

From: Ron Parker
Subject: Re: Kaleido_Tiles (pattern macro)
Date: 17 Mar 2000 08:23:11
Message: <38d231bf$1@news.povray.org>
And for those who don't want to use MegaPOV...

I've changed the semantics a bit.  The texture for the tile pattern is
passed to the macro instead of being a global variable, and I've added
a "Fade" parameter to control the size of the region between solid grout
and solid tile.  It must be between zero and the size of the grout.  See
the plane below for an example of how to invoke this macro.

#macro Kaleido_Tiles2( K_Tex, K_Grout, Fade ) 
  #local K_K=pigment {
    K_Tex
    warp {repeat x flip x} 
    translate x
    rotate 45*y    
    warp {repeat x flip x} 
    rotate 45*y    
    warp {repeat x flip x} 
    rotate 45*y    
    warp {repeat x flip x}  
  }

  gradient x pigment_map {[(K_Grout-Fade)/2 rgb 1]
     [K_Grout/2 gradient z pigment_map {[(K_Grout-Fade)/2 rgb 1]
     [K_Grout/2 K_K]}]}
  warp {repeat .5*x flip x}
  warp {repeat .5*z flip z}
#end   
   
plane { y 0
    pigment{
        Kaleido_Tiles2( pigment {bozo scale .2}, .2, .1 )
    }
}         

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

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