void RenderingEntity::buildPointsList()
{
// if mesh is not NULL and faces is not empty, get the points first
if (mesh && (!renderingFaces.empty()))
{
renderingPoints.clear()
std::set<Mesh::FaceHandle>::iterator it
Mesh::FaceVertexIter fv_it
for (it = renderingFaces.begin()it != renderingFaces.end()++ it)
{
for (fv_it = mesh->fv_iter(*it)fv_it++ fv_it)
{
renderingPoints.insert(mesh->point(fv_it))
}
}
}
// build the list
renderingList = glGenLists(1)
glNewList(renderingList, GL_COMPILE)
setMaterial(matRendering)
for (std::set<OpenMesh::Vec3d>::iterator it = renderingPoints.begin()it != renderingPoints.end()++ it)
{
//glBegin(GL_POINTS)
//glVertex3dv((*it).data())
//glEnd()
renderPoint((*it), SceneInterface::sphereRadius)
}
glEndList()
}
上面代码负责存入集合
下面代码用于显示
void RenderingEntity::renderingFaceEntities()
{
std::set<Mesh::FaceHandle>::iterator it
Mesh::FaceVertexIter fv_it
if (!mesh->has_vertex_normals())
{
mesh->update_normals()
}
// rendering the faces
glBegin(GL_TRIANGLES)
for (it = renderingFaces.begin()it != renderingFaces.end()++ it)
{
if (renderingMode &(CAD_RENDERING_MODE_SOLID_FLAT | CAD_RENDERING_MODE_WIRE_FLAT))
{
glNormal3dv(mesh->normal(*it).data())
}
for (fv_it = mesh->fv_iter(*it)fv_it++ fv_it)
{
if (!(renderingMode &(CAD_RENDERING_MODE_SOLID_FLAT | CAD_RENDERING_MODE_WIRE_FLAT)))
{
glNormal3dv(mesh->normal(fv_it).data())
}
glVertex3dv(mesh->point(fv_it).data())
}
}
glEnd()
}
网眼。网丝。mesh只是布料的一种结构特点,即网布,其材质可以多样:78%涤纶/22%帆布、100%尼龙、100%涤纶,并有不同的克重。
如果说是什么面料,根据材质有关:两种以上叫混纺面料。单一的化纤类,叫化纤面料。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)