POV-Ray : Newsgroups : povray.general : Large field of grass : Re: Large field of grass Server Time
4 Aug 2024 10:21:21 EDT (-0400)
  Re: Large field of grass  
From: Tim Nikias v2 0
Date: 6 Jun 2003 05:51:38
Message: <3ee0642a$1@news.povray.org>
Before my complete System Crash and my update
from v1.0 to v2.0, I had written a nice grass-generator
which would create a grassblade out of several triangles.
Of these, I would generate about 20 different ones.
Then, I'd take a random selection and built about 5
different grass-bundles, using about 10 of the 20 blades
per bundle. Then, these 5 bundles where saved as meshes
to disk, and later scaled for different size, rotated around
y to make the reuse of the same bundle less obvious, and
translated to desired locations.

An image dating back to those days can be found here:
http://www.digitaltwilight.de/no_lights/grass.jpg

It worked pretty fine, though I do think I had 512 MB
RAM at that moment. Still, using five bundles should
fit into 256 MB RAM, you'd just have to seperate generating
process from rendering process, and maybe use a lesser
resolution for the triangles.
Anyways, the handling for all this was pretty complicated.
I had to save the vertice-positions of the blades in arrays,
so that I may access them to put them into one large
mesh with several other blades. All were positioned on a circle
with blades pointing outwards, so I needed to take the
vertices, translate and rotate them. Only in the final
step, once the bundles are being generated, do I take the
vertices (which should, for every bundle, be at their proper
places now) and construct triangles which are saved to
disk.
So, for the blades I had an array like
Blades[Blade_Number][X_Pos][Y_Pos]. For a bundle, all
I had to do was take another array, like
Bundle[Bundle_Number][Blade][X_Pos][Y_Pos].
So, per Bundle, I'd save a selection of blades, each
with properly rotated vertices saved in X_Pos and Y_Pos.

Only drawback with this method was that the blades had the
same amount of triangles on the x-axis at the base and at the
top tip, but perhaps this could be taken care of by clipping
a diagonal line from base to tip (not in the sense of clipped_by,
but rather leaving a diagonal strip of triangles out).

Perhaps this gets you going, but perhaps this would be overkill
for your image (don't know what you're after, if its foreground
filling or just detail background...)

Regards,
Tim

-- 
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: Tim### [at] gmxde

> Hey guys!
>
> I'm trying to cover some hills with grass (in POV, our garden is not that
> big...). As Gille Tran's MakeGrass only does plane grass patches i'm
> searching for an other way to do this.
>
> I wrote a little grass generator (much simpler than MakeGrass). One blade
is
> one triangle. I'm now wondering if it is better to put this one triangle
in
> a mesh and place it several times or to put all the blades (quite a lot,
ca.
> 10000*10000) in one mesh. I tried the first method and ran out of my 256mb
> RAM, but i think the second one would not save any memory at all.
>
> Or is there another, better solution for large uneven areas of grass?
>
> Thanks a lot
> Florian
>
>


Post a reply to this message

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