Anders

09-12-2002, 07:18 AM

Hi, I'm currently trying to figure out a good way to reppresent 3D objects. What I have so far is the following:

A vertex consist of four coordinates (x,y,z,w)

An edge contains two vertices, the end points, and pointers to the two triangles, that share that edge.

A triangle contains three edges

An object class contains a list of vertices and a list of triangles

In my application, I need to find the outline of an object, i.e. the edges that contribute to the silhouette of the object. The way I would do this is to go through all the trinagles edges and ask if the two triangles that share it are front-facing and back-facing respectively. If so, the edges is part of the outline.

The problem is, that using the above structure will result in edges being reported as part of the silhouette twice. That is, two edges consisting of the two vertices P1 and P2, the will both be detected as silhoutte edge, when in fact only one of them is needed. Once when going from P1 to P2 and again when going from P2 to P1.

Does anyone have any suggestions how to avoid this?

Regards Anders

P.S. I realize this explanation may be a little cryptic, so if anything needs clarification, please say so http://www.opengl.org/discussion_boards/ubb/smile.gif

[This message has been edited by Anders (edited 09-12-2002).]

A vertex consist of four coordinates (x,y,z,w)

An edge contains two vertices, the end points, and pointers to the two triangles, that share that edge.

A triangle contains three edges

An object class contains a list of vertices and a list of triangles

In my application, I need to find the outline of an object, i.e. the edges that contribute to the silhouette of the object. The way I would do this is to go through all the trinagles edges and ask if the two triangles that share it are front-facing and back-facing respectively. If so, the edges is part of the outline.

The problem is, that using the above structure will result in edges being reported as part of the silhouette twice. That is, two edges consisting of the two vertices P1 and P2, the will both be detected as silhoutte edge, when in fact only one of them is needed. Once when going from P1 to P2 and again when going from P2 to P1.

Does anyone have any suggestions how to avoid this?

Regards Anders

P.S. I realize this explanation may be a little cryptic, so if anything needs clarification, please say so http://www.opengl.org/discussion_boards/ubb/smile.gif

[This message has been edited by Anders (edited 09-12-2002).]