iDevGames Forums
surface rendering from data points - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: surface rendering from data points (/thread-2944.html)



surface rendering from data points - mc1961 - Nov 13, 2007 05:53 AM

Hello,

I have what I thought would be a common situation but so far, after a lot of googling and studying, I am kind of stuck.

I have to render a surface for which I have XYZ data points (on a text file), where XY is a regular grid (but not fully filled). So far, I am defining triangles manually, and computing vertex normals, in order to use GL_TRIANGLES. There is way too many manual things in my way of doing this, so I started searching for a better solution.

My main problems are to sistematically define the triangles and decide which ones share a given vertex.

I have been studying NURBS, bezier surfaces, tessellation and a few other things, but I cannot find a way to plot my surface in an intelligent way.

I should say that I am not a programmer, but someone who learned how to program until now by studying examples found online (which has been quite good so far).

Thanks for any advise and pointer to examples to imitate Wink

Marc


surface rendering from data points - DesertPenguin - Nov 13, 2007 07:02 AM

Heightmap is a term for the data file. Often times they are stored in a simple .RAW file format. (The X and Z coordinates are not stored, only the height Y).

In order to render the heightmap, it is tyically loaded into a vertex array. This can be stored on the graphics card in OpenGL as a Vertex Buffer Object VBO.

Another useful technique is dividing up the terrain in a quadtree, and only rendering the nodes in the view frustum.

Try googling heightmap for more info...here are two that I saw:

http://www.lighthouse3d.com/opengl/terrain/index.php3?heightmap

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=45


surface rendering from data points - mc1961 - Nov 13, 2007 09:16 AM

Thanks! I'll definitely explore these heightmaps.

mc1961


surface rendering from data points - OneSadCookie - Nov 13, 2007 12:38 PM

I think what you're looking for isn't heightmaps, but delaunay triangulation...


surface rendering from data points - mc1961 - Nov 15, 2007 05:41 AM

Wow! Thanks, I did not know about this triangulation method!

mc1961


surface rendering from data points - m3the01 - Nov 15, 2007 01:40 PM

There is a technique that relies on rolling a sphere over the points for triangulation.

The Ball-Pivoting Algorithm for Surface
Reconstruction from
Bernardini at IBM!


Search google for the paper


surface rendering from data points - TomorrowPlusX - Nov 15, 2007 03:37 PM

A little googling on OSC's suggestion found this paper:
http://local.wasp.uwa.edu.au/~pbourke/papers/triangulate/index.html

Complete with implementations in several languages. Seems to triangulate sparse heightfield data. Pretty awesome.