29 #include <Utils/TriangleMesh.hh>
55 vector<Vector3<double> > vertices;
67 vector<Vector3<double> > normals;
68 for (
size_t vertexCnt = 0; vertexCnt < vertices.size(); ++vertexCnt) {
72 vector<Vector4<unsigned char> > colors;
73 for (
size_t vertexCnt = 0; vertexCnt < vertices.size(); ++vertexCnt) {
77 vector<Vector<int> > triangleIndices;
82 triangleIndices.push_back(tmpTriangle);
86 triangleIndices.push_back(tmpTriangle);
90 triangleIndices.push_back(tmpTriangle);
94 triangleIndices.push_back(tmpTriangle);
98 triangleIndices.push_back(tmpTriangle);
102 triangleIndices.push_back(tmpTriangle);
104 mesh.
SetMesh(vertices, normals, colors, triangleIndices);
128 vector<Vector3<double> > vertices;
143 vector<Vector3<double> > normals;
144 for (
size_t vertexCnt = 0; vertexCnt < vertices.size(); ++vertexCnt) {
148 vector<Vector4<unsigned char> > colors;
149 for (
size_t vertexCnt = 0; vertexCnt < vertices.size(); ++vertexCnt) {
153 vector<Vector<int> > triangleIndices;
158 triangleIndices.push_back(tmpTriangle);
162 triangleIndices.push_back(tmpTriangle);
166 triangleIndices.push_back(tmpTriangle);
170 triangleIndices.push_back(tmpTriangle);
174 triangleIndices.push_back(tmpTriangle);
178 triangleIndices.push_back(tmpTriangle);
182 triangleIndices.push_back(tmpTriangle);
186 triangleIndices.push_back(tmpTriangle);
188 mesh.
SetMesh(vertices, normals, colors, triangleIndices);
198 int main(
int argc,
char* argv[])
201 cout <<
"creating triangle mesh..." << endl;
205 GenerateMesh2(origMesh);
208 cout <<
"getting biggest segment..." << endl;
215 <<
" triangles" << endl;
217 <<
" triangles" << endl;
const std::vector< BIAS::Vector< int > > & GetTriangleIndicesRef() const
void GetBiggestConnectedSegment(TriangleMesh &biggestSegment) const
Returns the biggest connected segment of this triangle mesh.
void SetMesh(BIAS::Image< unsigned char > texture, std::vector< BIAS::Vector3< double > > meshVertices, std::vector< BIAS::Vector3< double > > vertexNormals, std::vector< BIAS::Vector2< float > > textureCoords, std::vector< BIAS::Vector< int > > triangleIndices)
Create and represent a 3D triangle mesh.