POV-Ray : Newsgroups : povray.advanced-users : My first grass. : Re: My first grass. Server Time
29 Jul 2024 06:25:15 EDT (-0400)
  Re: My first grass.  
From: J  Diehl
Date: 30 Sep 2002 02:45:07
Message: <web.3d97f2bc855d30e7f70c33440@news.povray.org>
Corey Woodworth wrote:
>I'm making an image with a big HF in the foreground. I want to put grass on
>the HF but only on the flat areas. What is the most conventional way to do
>this? I can make an image that describes which areas should and shouldn't
>have grass by using world forge, but I still wouldn't know how to apply the
>image to a macro for placing grass. Thanks in advance!
>
>Corey
>http://www.4gigs.com/~schitzo/
>

First, declare your heightfield picture and your grass-info-picture each as
a function (see "6.1.6.5 Declaring User-Defined Color Functions" in your
POV-documentation)
Then use a loop to randomly 'try' where grass can be (where the
grass-function is above 0.5, i.e.).
Last, get the height info from your heightfield function where to put the
grass in y-direction.
It will be a bit tricky to get the right coordinates and to compensate the
scaling of your heightfield, but that's the best way I thing.
Any other ideas?


Post a reply to this message

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