|
![](/i/fill.gif) |
This is a general reply to the various questions/threads on grass.
There is a way!!!
Assume you want to cover a square 10x10 units.
First write a short routine to create a blade of grass as a mesh. Use say
4-8 triangles.
Place this inside a loop that creates, say, 1000x1000 blades of grass spread
over the 10x10 area.
This should end up as a single mesh{} object declared as, say, GrassPatch,
apply the texture to this object, not the individual blades.
Finally, use another set of loops to create, say 400 copies of the object
GrassPatch. Rotate these by random multiples of 90 degress around the
vertical axis, scale some of them by -1 to flip horizontally and translate
them by a random amount of +/- 1 units in the plane. This does put some
grass outside the fence, but makes the edges very realistic. You can always
clip the edges!
The net result is 400x1000x1000 blades of grass. A total of several BILLION
triangles. I have rendered these scenes with 64 Meg of memory with no
problems. They even render fast. The key is the fact that copies of mesh
objects are just pointers and you can have LOTS of them.
Using several different GrassPatch objects gives a very realistic patch of
grass/weeds/wheat/reeds ...
Hope that is useful.
Regards
Gordon
<gbe### [at] birdcameron com au>
PS I didn't post the actual plug_in as its all at home and I'm at work. Mail
me if you want it.
Post a reply to this message
|
![](/i/fill.gif) |