B
broli
hello i am trying to implement a hald edge data structure.
In my project, I have to read a file that contains the geometrical
specifications of a 3d object which has been converted into a
triangular mesh. I have specified the format of the file in a previous
thread -
http://groups.google.co.in/group/comp.lang.c/msg/17f95654400d414d
(ignore the program bit just read about the format of file)
^^ I have stored all this information in a vertex list. Sequentially
in the way they occur. After the coordinates, the file specifies 3
indices into the vertex list(which point to 3 vertices) needed to
define a triangle.
Now I'm successfully able to code a program read the data from the
file
with the help of data structures that I created for vertex, object and
But now, I want to implement adjacency queries for which I need half
edge data structure. I do not understand how to create a half edge
data structure from this plethora of information (i.e. vertex list and
triangle list). I looked on flipcode and found some information about
the structures involved -
struct HE_edge
{
HE_vert* vert; // vertex at the end of the half-edge
HE_edge* pair; // oppositely oriented adjacent half-edge
HE_face* face; // face the half-edge borders
HE_edge* next; // next half-edge around the face
};
struct HE_vert
{
float x;
float y;
float z;
HE_edge* edge; // one of the half-edges emantating from the
vertex
};
struct HE_face
{
HE_edge* edge; // one of the half-edges bordering the face
};
Now my main question : How do I fit all this data into the structures
above ?? Do I need to loop through each vertex in the vertex list and
each triangle in triangle list ??
In my project, I have to read a file that contains the geometrical
specifications of a 3d object which has been converted into a
triangular mesh. I have specified the format of the file in a previous
thread -
http://groups.google.co.in/group/comp.lang.c/msg/17f95654400d414d
(ignore the program bit just read about the format of file)
^^ I have stored all this information in a vertex list. Sequentially
in the way they occur. After the coordinates, the file specifies 3
indices into the vertex list(which point to 3 vertices) needed to
define a triangle.
Now I'm successfully able to code a program read the data from the
file
with the help of data structures that I created for vertex, object and
But now, I want to implement adjacency queries for which I need half
edge data structure. I do not understand how to create a half edge
data structure from this plethora of information (i.e. vertex list and
triangle list). I looked on flipcode and found some information about
the structures involved -
struct HE_edge
{
HE_vert* vert; // vertex at the end of the half-edge
HE_edge* pair; // oppositely oriented adjacent half-edge
HE_face* face; // face the half-edge borders
HE_edge* next; // next half-edge around the face
};
struct HE_vert
{
float x;
float y;
float z;
HE_edge* edge; // one of the half-edges emantating from the
vertex
};
struct HE_face
{
HE_edge* edge; // one of the half-edges bordering the face
};
Now my main question : How do I fit all this data into the structures
above ?? Do I need to loop through each vertex in the vertex list and
each triangle in triangle list ??