|
 |
> Awesome!
Thanks!
> How do you place trees with a pigment function? I would like to do the
> same with the grass in my alley scene, so the grass won't grow on the
> asphalt...
Indeed you could use this technique for that... it's very easy, specially
if you are already using a heighfield for the ground. Make a copy of the
grayscale map, and paint black the zones where you don't want grass, and
white for the rest. Then declare a pigment function of it:
#declare f_grass_distribution=
function{
pigment{
image_map{png "your_image.png"}
rotate 90*x
translate <-.5,0,-.5>
scale as_your_heightfield
}
}
Now, build the classic while loop where you shot the heighfield with
trace(), but for each placement found, test first if the grass distribution
allows a grass patch there:
...
#if (f_grass_distribution(Inter.x,0,Inter.z).gray>0)
object{grass_patch
...
translate Inter
}
#end
...
Hope this helps...
--
Jaime Vives Piqueres
http://www.ignorancia.org
Post a reply to this message
|
 |