Jump to content
  • Advertisement
Sign in to follow this  
areksu

OpenGL Mesh from unordered points?

This topic is 3546 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I'm a student programmer who has recently begun my learning experience with OpenGL (2 months ago). So far, I have quite enjoyed the intuitiveness of the API, and the abundance of online resources/tutorials. However I come to these forums with a problem that I cannot find the answer for on the web: Is it possible to use OpenGL to generate a basic mesh from a set of unordered points? I have already experimented with the OpenGL tessellation routines, and though I was successfully rendering a complex polygon, it wasn't quite what I needed. My data points are contour-less and may be supplied to the program in any order. I need a way to essentially 'throw a blanket' over the points, that is, to generate a surface encompassing all the points, without holes. Here are some example pictures to illustrate my situation: The data points: But due to the ordering, tessellation results in: I just want a mesh that covers the whole dome. So if anyone knows how I could do this with OpenGL, it would be much appreciated. Thanks in advance, areksu

Share this post


Link to post
Share on other sites
Advertisement
"Throwing a blanket" over the points sounds like finding the convex hull, which will be exactly what you want as long as your object is actually convex. If it isn't, there's no one true solution, but the most popular one is Delaunay triangulation. More info here. In any case, OpenGL won't do any of this stuff on its own, though of course it'll render the mesh once you calculate it in your own code.

Share this post


Link to post
Share on other sites
constructing a mesh from points is a very hard problem, and indeed, nothing that openGL will for you.
Look into DeLaunay triangulations (creating triangle structures from the points)

You'll have to specify what your result should be like with respect to the unput points. Must the mesh conatin only those points, and simply calculate triangle structures among them (delaunay). is it allowd to add new points to a nmesh (tesselations)?? etc etc.

In its most basic. the get A mesh that is guaranteed to contain all points, simply get the center of gravity, search the farthest vertex from that point from the set, and construct a spehere with exatcly that radius, positioned at the center.
(due to resolution etc, remmber that points can still exceed the sphere in practice, but never when the sphere is assumed to be perfect)

'throwing a blanket' can simply be done by starting with a quad plane above and lowering all points untill they 'hit' one of the input points.



Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!