|
|
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
|
|
|
|
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
|
|