flopoloco's picture

Terrain Heightmapping

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

Height Mapping In OpenToolkit

AttachmentSize
OpenTKHeightmap.png61.08 KB
OpenTKTutorials.rar470.36 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
flopoloco's picture

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 :)

janequorzar's picture

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.

31337's picture

WOW thats cool! Is there a technique to make this looking more smooth, and less computationally intensive?

flopoloco's picture

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.

31337's picture

That would be amazing.

31337's picture

Is there a technique to smooth the vertexes and map a higher resolution texture over this heightmap?

flopoloco's picture

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