home page icon Flash Bestiary / Natural Phenomena / Windy Grass

Windy Grass

This movie simulates a field of grass.

Each blade of grass is modeled using two points - a midpoint (cx,cy) and an end point (ex,ey).

Each individual point is moved using a random vector (turbulence).

An additional 'global' vector is used to move all the grass together (wind).

Although simple, this is *not* a particularly realistic wind model, and you'll find that by tweaking the sliders you can make it look pretty odd.

UPDATE: The source code below now contains an Actionscript 3 version, in addition to the original Flash MX code.


sourcecode iconDownload the flash project
book iconJim's Favorite Actionscript Books
wiki iconAsk Jim about Actionscript
Next: Fern Fractal

Having trouble opening the project? You may need to Upgrade to Flash CS3

Copyright © 2003,2008 by Jim Bumgardner. All Rights Reserved.        Leave Jim some feedback