Smooth terrain rendering
Posted
by
__dominic
on Game Development
See other posts from Game Development
or by __dominic
Published on 2010-12-27T21:21:49Z
Indexed on
2010/12/28
1:02 UTC
Read the original article
Hit count: 682
I'm trying to render a smooth terrain with Direct3D. I've got a 50*50 grid with all y values = 0, and a set of 3D points that indicate the location on the grid and depth or height of the "valley" or "hill". I need to make the y values of the grid vertices higher or lower depending on how close they are to each 3D point. Thus, in the end I should have a smooth terrain renderer.
I'm not sure at all what way I can do this. I've tried changing the height of the vertices based on the distance to each point just using this basic formula:
dist = a² + b² + c²
where a, b and c are the x, y, and z distance from a vertex to a 3D point. The result I get with this is not smooth at all.
I'm thinking there is probably a better way.
Here is a screenshot of what I've got for the moment: https://dl.dropbox.com/u/2562049/terrain.jpg
© Game Development or respective owner