DirectX Terrain and a dirt path

Started by
0 comments, last by mozie 13 years, 7 months ago
Please forgive me if I misuse terminology here but I've got a problem with creating dirt roads/pathways on a terrain generated from a heightmap. What I've managed so far through managed directx 9 and reading through tutorials is to create a heightmap from a greyscale image and use the Effect class to blend 2 textures together giving a mountain/hillside effect which is nice. What I'd like to do is add textured winding pathways/dirt roads around the terrain, but I don't know how or where to start. If anyone can point me in the right direction, I'd appreciate it greatly.

Overview:

Managed DirectX (C#)
Using greyscale heightmaps
Using Pixel shader and Effect class for texturing blending
Want to add winding roads, but not sure where to start...

Any and all help is greatly appreciated,
-AT
Advertisement
Maybe you could get a path finding algorithm and use it to follow the low points in the height map from two points. Modify the terrain geometry vertices where the path is found to make it more level, like a road - you might be able to 'paint' some average to the height map gray scale so that it generates the vertices for you. You should probably also alter the displayed texture based on the two dimensional coordinates of the path, so that it has a uniform color. The path finder could probably also be set with a height delta threshold so that it goes over some hills instead of strictly following the absolute lowest points (but I have never written any path finding so I can't tell you how). That might make for some interesting off-roads.

It is going to be a lot of work whatever you do, but that is where I would start. Getting as far as you have, this should be doable.

This topic is closed to new replies.

Advertisement