Jump to content


Triangle mesh LOD


3 replies to this topic

#1 Zeophlite

    New Member

  • Members
  • Pip
  • 6 posts

Posted 22 February 2007 - 07:07 AM

Hey,

I have a mesh of triangles to represent terrain.
Is there any LOD-esque algorithm that i could use to reduce the number of triangles drawn?

Posted Image
Click to see enlarged

Here's an example of my mesh (without heights - each vert is actually a point on the surface of a sphere).
The red lines help highlight the vertices that are surrounded by a 5-triangle fan (there are only ever 12 in the mesh).
All others are verticies (in the order of 10,000s) are surrounded by 6-triangle fans.

The data so far is stored as individual verticies, edges and faces like so:
1 large vector of verticies - each vertex has a variable int array, (usually int[6], sometimes int[5]) that corrosponds to the edges that are connected to the vertex
1 large vector of edges - each edge has 2 ends (ints corrosponding to the index from the verticies vector)
1 large vector of faces - each face has 3 corners (ints corrosponding to the index from the verticies vector)

The triangles are all drawn individually, either in wireframe by looping through the edges and drawing gl_lines, or solid, by looping through the faces and drawing gl_triangles.

The project is currently rendered in OpenGL.

I'm looking for any ideas, or relevent schemes. I don't mind learning and coding, and all help is greatly appreaciated. Even "Sorry, can't be done.", although I would want a reason. :yes:

Cheers,

Daniel

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5307 posts
  • LocationBellevue, WA

Posted 22 February 2007 - 04:21 PM

Google for 'geomipmapping'. This is a simple and easy terrain LOD scheme.
For more complicated schemes, check out the papers listed here.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 dave_

    Senior Member

  • Members
  • PipPipPipPip
  • 584 posts

Posted 22 February 2007 - 11:22 PM

Just out of curiosity, why have you taken the approach of drawing the 5 triangle fan? Is that some limitation to the way you do it. Is it a homework question?


If not just do what reed suggests, or otherwise look at http://research.microsoft.com/~hoppe/

#4 Zeophlite

    New Member

  • Members
  • Pip
  • 6 posts

Posted 23 February 2007 - 06:41 AM

The mesh is originally a Icosahedron (20 sided) thats subdivided several times.

I wanted to use this scheme to make entire world terrains, and it prevents problems with other shaped meshes - like having tiny triangles on the top of the sphere

Thanks for the term, I'll start googling :yes:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users