|
|
On Tue, 18 May 2010 14:59:20 +0200, Jaime Vives Piqueres
<jai### [at] ignoranciaorg> wrote:
>> Awesome!
>
> Thanks!
>
>> How do you place trees with a pigment function? I would like to do th
e
>> 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 t
he
> grayscale map, and paint black the zones where you don't want grass, a
nd
> 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 wit
h
> 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...
>
>
Thanks! I'll give it a try.
-Nekar Xenos-
Post a reply to this message
|
|