POV-Ray : Newsgroups : povray.newusers : Grass on heightfields : Re: Grass on heightfields Server Time
29 Jul 2024 14:12:49 EDT (-0400)
  Re: Grass on heightfields  
From: Tim Nikias
Date: 25 Oct 2005 18:23:04
Message: <435eb048$1@news.povray.org>
> I tried different grass macros (Trans gills etc) and they all grow grass
on
> planes. I am looking for a tool to grow grass on my heightfield. It seems
> there was a tool (lawnmaker) back in 2003 but the reference seems gone.
>
> Any ideas?

Well, I'm not sure how deep you want to go, but you could modify Gilles
Tran's grass stuff to your needs. For example (shameless plug follows) I've
written a set of macros to easily sample objects (which includes
heightfields) and have various macros to remove unwanted samples (like
samples on steep slopes). They're called the "Surcoat-Macros" and you can
find them in the downloads section of my website (url in my sig).
If you can then get Tran's grass to generate just a small patch, you could
place that patch onto the samples.

If that's too much trouble, you could even look if my Surcoat2Hair Macros
would suffice, though I suspect your grass would look more like fur then...

If all that's a little too complicated, just a simple thing: look in the
docs for "trace", which can be used to cast a ray from a position into a
certain direction. You have to supply it with an object (in this case, your
heightfield), and get a position and normal back. Use that data to place a
strand of grass, rinse and repeat until you've got enough grass. :-)

Regards,
Tim

-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

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