|
kurt miller's homepage
( My development journal and homepage has moved to a new system here: kurtm.flipcode.com ) |
|||
I had some trouble sleeping tonight, as I found myself with a strange and sudden urge to mess with some terrain generation; partly to test the tool interface I talked about in my last update, and partly because I know there are some terrain-related algorithms/optimizations I've been thinking about recently that I'd eventually like to work with. To start though, I just wanted to get something on-screen, which means I needed some elevation data to build the terrain from. After poking around the net for a bit, I found this page with some reference data. Unfortunately its in BT format, and I just wanted some greyscale heightmap images to work with. As a quick and hacky substitute, I ended up just using the pre-rendered texture from one of the data sets as the heightmap itself. After a bit of coding on a terrain editing dll for the editor, a nice little heightmap loader and big 'generate' button let me finally get on with actually generating a terrain mesh. Here's a screenshot: ![]() Not bad for an hour or so of work. Then again there's no magic involved here. The above mesh is built from a typical brute-force grid, which reads each pixel from the height map and sets the corresponding vertex to an appropriate height. What I'd like to do though is have every aspect of the terrain generation configurable in the editor, such as the height deltas, grid size, etc. I also plan to add some basic 2D 'paint' tools to the heightmap editor, where areas can be depressed and so on. As for how I plan to manage the level of detail and rendering in-engine, that's something I hope to spend some time on in the days to come. I'm just glad the editor interface is turning out to be as convenient as I'd hoped. Anyway, more later. I'm off to sleep. |
|||
| Site Contents Copyright (c) 2002-2004 Kurt Miller. Please do not reprint this jibberish anywhere. |