Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

if a Vertex looks like this:

struct vertex {
    vec3 point;
    vertex [] connected;
};

Can I tell if this makes a solid shape with no holes? (e.g a sphere or a cube, NOT a sphere with a side missing for example)

(if i can see the back of a face from outside of the shape then it is not solid)

share|improve this question

1 Answer 1

up vote 7 down vote accepted

This is quite a tricky question.

My idea to test if an object has no hole is to check all edges and make sure they all belong to 2 different triangles. If an edge only belong to one triangle, it means it's a border of the whole surface, meaning there's a hole.

This could be harder if you have different vertex at the same position (for example to have different texture coordinates per face).

share|improve this answer
    
I managed to get it working but i have to give it the triangles. I could not work out how to generate them myself. But its good enough –  tm1rbrt Aug 24 '11 at 19:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.