Jump to content

Manipulating Vertices


Recommended Posts

Hi all,

I'm having trouble finding a way to manipulate vertices and their attributes. After scanning GU_Detail and associated classes, I've noticed that GEO_Primitive is the closest I can get to a GEO_Vertex from any of the G*_Detail member functions... but at that level, all vertex-related members are pure virtual, since they're defined by the actual geo types later on.

What I need to do is:

add vertex attribute to detail
foreach prim in detail
   foreach vertex in prim
      get connected vertices (closure)
      eval/assign attribute based on connected vertices
   end
end

The only part I can't find is the "foreach vertex in prim" bit, the rest I'm fine with.

Thanks.

Link to comment
Share on other sites

for( i = 0; i < prim->getVertexCount(); i++ )
    GEO_Vertex &vertex = prim->getVertex(i);

Does that help?

Thanks, I'll give that a try when I get home.

I had seen getVertexCount() defined in GB_Primitive as a pure virtual, and then not actually implemented until GEO_Hull, GEO_Face, etc, so I thought it wouldn't work from a GEO_Primitive... but now I realize we're talking about a pointer not an instance... yeah that should work. I'll give it a go. Thanks!

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...