Commit e12cae2e by Nathan H. Bean

parent ae9d7c6e
 --- title: "Introduction" pre: "1. " weight: 1 date: 2020-03-24T10:00:00-05:00 --- Now that we understand how 3D worlds are built from triangle meshes, and how we can use cameras to explore those worlds, let's start putting those ideas to work. In this section, we'll focus on creating terrain from a heightmap - a grayscale bitmap representing the changing elevation of the ground. Like our earlier examples, we'll start from a starter project with our assets pre-loaded. In addition, we'll include the `ICamera` interface and the `FPSCamera` we created in the lesson on Lighting and Cameras. It is also preloaded with public-domain content assets, including a heightmap from Wikimedia and a grass texture from Para on OpenGameArt's [Synthetic Grass Texture Pack](https://opengameart.org/content/synthetic-grass-texture-pack). You can find the starter project here: [https://github.com/ksu-cis/heightmap-terrain-starter](https://github.com/ksu-cis/heightmap-terrain-starter) \ No newline at end of file
 --- title: "Heightmaps" pre: "2. " weight: 2 date: 2020-03-24T10:00:00-05:00 --- You might be wondering just what a _heightmap_ is. If you've ever used a [topographic map](https://en.wikipedia.org/wiki/Topographic_map), you've seen a similar idea. Countour maps include _countour_ lines_, lines that trace when the ground reaches a certain altitude. Inside the line is higher than that altitude, and outside of the line is lower (or visa-versa). The countours themselves are typically marked with the altitude they represent. A heightmap is similar, but instead of using lines, each _pixel_ in the map represents a square section of land, and the color value at that point indicates the average altitude of that square. Since there is only one value to represent, heightmaps are typically created in grayscale. And, to optimize space, they may also be saved in a monochrome format (where each pixel is stored as a single 8-bit value, instead of the 32-bits typical for storing RGB values). ![Heightmap Example]({{}}) You can obtain heightmaps in a number of ways. You can draw a heightmap with any raster graphics program, though it takes a lot of skill and patience to make one that mimicks natrual terrain. You can also get real-world heightmaps directly from organizations like the [USGS](http://earthexplorer.usgs.gov/) or [NASA's Viewfinder Project](http://viewfinderpanoramas.org/Coverage%20map%20viewfinderpanoramas_org3.htm). Or you can generate one using Perlin Noise and algorithms that mimic the results of plate tetonics. There also exist many height-map generation programs, both open-source and commercial. Along with the height map, you also need to know the sampling resolution (how large each terrain square should be), and the scale that should be applied to the heights (as the pixel values of the heightmap will be in values between 0 and 255). Now, let's turn our attention to creating a Terrain class that will use a heightmap. \ No newline at end of file
This diff is collapsed.
 --- title: "Summary" pre: "6. " weight: 6 date: 2020-03-24T10:00:00-05:00 --- Now you've seen the basics of creating a terrain from a heightmap. Armed with this knowledge, you can create an outdoor game world. You can find or create additional heightmaps to add new terrains to your game. You can swap the textures to create different kinds of environments as well. But you could also create an even _larger_ worlds by using multiple terrains and stitching them together at the edges - a technique often called _terrain patches_. With enough of them, you could create an infinite world by looping back to a prior terrain. Or you could rotate a terrain sideways to create a rugged cliff face, or upside down to create a cavern roof. And you could also change out the `BasicEffect` for a custom effect that could blend textures based on height changes, or provide a detail texture. You could also light the terrain realistically if you adjusted the surface normals to be perpendicular to the slope at each vertex. \ No newline at end of file
 +++ title = "Heightmap Terrain" date = 2020-03-20T10:53:05-05:00 weight = 10 chapter = true +++ ### Game Development Techniques # Heightmap Terrain Keep your feet on the ground! \ No newline at end of file

9.13 KB

18.6 KB

17.5 KB

17.3 KB

393 KB

5.05 KB

3.12 KB

4.34 KB

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!