Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Today's Posts

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 15th June 2005, 04:30 AM   #1
PerFnurt
Member
Expert member
 
Join Date: Aug 2003
Location: Eslöv, Sweden
Posts: 93
Default Getting vertex index

Hiya!

Is there an easy way to get/display the index of a selected vertex?

By index I mean what I'd get if I'd do something like

Code:
Vertex* selVertex = getSelectedVertex();
if (selVertex!=NULL)
{
  ACObject* ob = getObjectThatOwnsVertex(selVertex);
  int index=0;
  List * vertices = ac_object_get_vertexlist(ob);
  for (List *vp = vertices; vp != NULL; vp = vp->next;++index)
  {
    if (vp == selVertex)
      break;
  }

  // Should always be true, else something 
  // is wrong in getObjectThatOwnsVertex
  if (vp!=NULL) 
  {
    // index holds the "vertex index"
    display(index);
  }
}
Is there some nifty tcl hack that can accomplish this?

Or would I have to write a complete plugin?
If so, would getObjectThatOwnsVertex actually require traversing every object and their vertices until a match is found or is there some more efficient way?


Thanks
__________________
/Per

www.perfnurt.se
PerFnurt is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 02:50 PM.


AC3D Forum
(C) Inivis Limited 2020