|
![](/i/fill.gif) |
In article <3ABA191B.A47B8A97@mail.rit.edu>, John Chatham
<Wyv### [at] mail rit edu> wrote:
> I've been using crackle to make randomly placed armor plates, but I also
> need to have one plate in a specific location, and have it not overlap
> any of the random plates. What I'd like to do is something like this:
> #macro my_pattern (V)
> max( crackle (V), spherical (V) )
> #end
> #declare my_texture = texture{ my_pattern texture_map{...}}
> Is there any way to do something like this?
Using MegaPOV, it's easy...just use a function pattern.
#macro MyPattern()
#local Crackle =
function {
pigment {crackle color_map {[0 rgb 0][1 rgb 1]}}
}
function {
max(Crackle(x, y, z), max(0, 1-sqrt(sqr(x) + sqr(y) + sqr(z)))
}
#end
#declare MyTexture = texture {MyPattern() texture_map{...}}
You could also declare a spherical pigment function and use that instead
of "max(0, 1-sqrt(sqr(x) + sqr(y) + sqr(z))", but it wouldn't be as
flexible, and might be slower. Or it might be faster...
MacMegaPOV is available here:
http://users.skynet.be/smellenbergh/
BTW, it's a good idea to always use at least one capital letter in
variable/macro names, to avoid interference from a keyword in a future
version. Keywords will always be lower-case, so it's easy to avoid name
collisions.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |