Jump to content

Face From Vertex?


Recommended Posts

I would think this would be straight forward, just can't find it. I have a bunch of GEO_Vertex stored and I'd like to find out what face a vertex belongs to (if any). This isn't possible with GEO_Point since it could be a list of faces.. but with a vertex I'm guessing it's either none or 1. I can't find a method to return that given a vertex. Any thoughts?

thnx

d

Link to comment
Share on other sites

I would think this would be straight forward, just can't find it. I have a bunch of GEO_Vertex stored and I'd like to find out what face a vertex belongs to (if any). This isn't possible with GEO_Point since it could be a list of faces.. but with a vertex I'm guessing it's either none or 1. I can't find a method to return that given a vertex. Any thoughts?

thnx

d

I don't believe that the vertex has a back-pointer to the primitive. So the only way to find it would be to search every primitive.

If you're doing this a lot, you might want to build your own list of back-pointers...

Link to comment
Share on other sites

I don't believe that the vertex has a back-pointer to the primitive. So the only way to find it would be to search every primitive.

Fortunately "every primitive" does not have to mean EVERY primitive. If you use a GQ_Detail to represent your geometry, you can use the FOR_QUAD_EDGE() macro to iterate over the point's shared faces to see which one actually contains the vertex.

Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...