
Terrain Heightmapping
Posted Friday, 9 January, 2009 - 19:38 by flopoloco inA simple example on how to do simple heightmapping with OpenTK, enjoy...

| Attachment | Size |
|---|---|
| OpenTKHeightmap.png | 61.08 KB |
| OpenTKTutorials.rar | 470.36 KB |

A simple example on how to do simple heightmapping with OpenTK, enjoy...

| Attachment | Size |
|---|---|
| OpenTKHeightmap.png | 61.08 KB |
| OpenTKTutorials.rar | 470.36 KB |
Comments
Re: Terrain Heightmapping
General Knowledge:
GLU is an OpenGL utility library (an extra helper library), that it contains various goodies to help development such as Textures, Matrices, e.t.c. more information here http://www.opengl.org/resources/libraries/glx/
GLU on OpenTK:
Using GLU is outdated and is discouraged, in that spirit GLU support is dropped and removed in OpenTK 1.0, so no need to worry about it anymore.
GL:
You can say that GL matches the gl prefix from the OpenGL commands.
for example is you say glBindBuffer in C++
in OpenTK you would say GL.BindBuffer
GL is just a namespace that contains all the OpenGL commands.
Same goes for OpenTK.Graphics namespace, it might contain graphics code relevant to OpenTK,
as also as OpenTK.Input, is a namespace that contains OpenTK code for user input.
If I did not explain something good ask me to repeat :)
Re: Terrain Heightmapping
No no, that makes perfect sense. . Thank you very much for your example and an understanding. This is great to learn from. I had not known that OpenGL could be used this easily with C#. Glad to know it can.
Re: Terrain Heightmapping
WOW thats cool! Is there a technique to make this looking more smooth, and less computationally intensive?
Re: Terrain Heightmapping
Sorry for this outdated code, the most proper way is to create vertex buffer/array objects, that way it will be very fast.
I will try to create it someday.
Re: Terrain Heightmapping
That would be amazing.
Re: Terrain Heightmapping
Is there a technique to smooth the vertexes and map a higher resolution texture over this heightmap?
Re: Terrain Heightmapping
For smoothing the terrain you could use normals and shading modes set to smooth. Other than that higher resolution means more polygons. Sorry for not updating the code but I have not enough time.
However I found that there is guy who created an amazing terrain engine. It worth to have a look to his project.
http://www.youtube.com/watch?v=X2yhOGSaExM&feature=related