teaching machines

Feature 10 Post Mortem

April 19, 2013 by . Filed under cs455, postmortems, spring 2013.

For this feature, I decided to make some grass for my scenery out of billboards.  I ran a Google image search and came up with this nice little grass tuft, taken from unity3d.com.

I thought it would be nice to make fields of grass, only I would need a way to place these guys into my scene so that they would actually correspond to the terrain height.  I figured the best way to do this was to make use of the array I used earlier to map my camera to the terrain, and re-apply it to generate billboards for my terrain.  Then I decided that, while I was at it, I might as well make an easy way to pick which areas of my terrain I wanted to be grassy.

So I made a nice little PlantGen function, that will take in a grayscale image, and generate billboards at the corresponding locations on my terrain.  It slightly randomizes both density of plants and location, But in general, the whiter the pixel, the more grass you’re going to get at that location.

Here’s a zoomed out shot to show the plant mapping image and the corresponding render of grass in my scene.

  

Below is a short video that shows what its like to run through these lush grasslands…
[youtube http://www.youtube.com/watch?v=9DfTZ4Wlfwg?feature=player_detailpage]