高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】how to get vertex of polyfacemesh
how to get vertex of polyfacemesh
how to get vertex of polyfacemesh
hi, all:
i know how to get all vertices of a polyfacemesh entity.
here is the code:
oddbpolyfacemeshptr ppoly;
..........................
oddbobjectiteratorptr piter = ppoly->vertexiterator();
for (; !piter->done(); piter->step())
{
oddbpolyfacemeshvertexptr pvertex =
piter->entity()->queryx(oddbpolyfacemeshvertex::desc());
if (!pvertex.isnull())
{
odgepoint3d point(pvertex->position());
..............................
}
else
{
oddbfacerecordptr pface =
piter->entity()->queryx(oddbfacerecord::desc());
if (!pface.isnull() )
{
for(int i = 0; i < 4; ++i)
int vertexindex = pface->getvertexat(i);
//how to get coords of these four vertices ????????????
}
}
}
"getvertexat()" function of "oddbfacerecord" class allows you to get
index of vertices for each polyface. how to use these indices to
get vertices ??? i need the coords of 4 vertices for each polyface
in order to draw it.
thanks in advance!
gary
you can get vertex coordinates into gepoint3d array iterating through oddbpolyfacemeshvertices and use indices to access values in your temporary array
sergey slezkin
quote:
originally posted by sergey slezkin
you can get vertex coordinates into gepoint3d array iterating through oddbpolyfacemeshvertices and use indices to access values in your temporary array
thank you for your answer, sergey!
one more question:
the index of vertex starts with 1 or 0 ???
thanks.
gary
vertex index starts with 1. negative value indicates that corresponding edge is invisible.
sergey slezkin
|