Jump to content
  • Advertisement
Sign in to follow this  
Wizumwalt

how to create a graph

This topic is 4703 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

I need to create a graph for my model so that I can traverse it and find all the unique edges and adjacent faces in my mesh. Right now my mesh is made up of all triangles. I was thinking of using a winged-edge data structure. How do I create this graph or what's it called? Is this a tree or a matrix, or ...? Any help/advice/google words/comments much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Wizumwalt
I need to create a graph for my model so that I can traverse it and find all the unique edges and adjacent faces in my mesh. Right now my mesh is made up of all triangles. I was thinking of using a winged-edge data structure. How do I create this graph or what's it called? Is this a tree or a matrix, or ...?

Any help/advice/google words/comments much appreciated.


Well, a graph is a graph. It is a specific data structure. you can create one by using two structures (oversimplified pseudocode):


template <class T> struct Node
{
list<Link*> links;
T data;
};
template <class T, class VAL> struct Link
{
Node<T> *from;
Node<T> *to;
VAL value;
};


You can google for 'graph "data structure"' - it will give you a bunch of links (among them: the boost graph library).

HTH,

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Maybe he means a scene graph?

Mr. Creamy

Share this post


Link to post
Share on other sites
No, not a scene graph. I have a mesh of triangles and I'm trying to make a true representation and construct a graph so that I can search it properly for all it's edges. That's my final goal. So I need to find a data structure to build the graph and an algorithm to search it so I can build a unique list of all it's edges.

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!