Skip to content
Snippets Groups Projects
Commit f3b25556 authored by Vladimír Ulman's avatar Vladimír Ulman
Browse files

ActiveMesh::ImportVTK() imports triangles in the expected windiness.

Normals are not used when drawing triangle edges.
parent 8aafc350
No related branches found
No related tags found
No related merge requests found
......@@ -264,9 +264,10 @@ int ActiveMesh::ImportVTK(const char *filename) //surface version
file >> v1 >> v2 >> v3;
//save v1,v2,v3 (TODO: if not already saved...)
//make triangles use CW winding order
ID.push_back(v1);
ID.push_back(v2);
ID.push_back(v3);
ID.push_back(v2);
norm.push_back(fictiveNormal);
--itemCount;
......@@ -360,7 +361,7 @@ int ActiveMesh::ImportVTK_Volumetric(const char *filename)
//read all polyhedra vertices
int ignore,v1,v2,v3,v4;
while (itemCount > 0 && file >> ignore)
while (itemCount > 0 && file >> ignore && ignore == 4)
{
file >> v1 >> v2 >> v3 >> v4;
......
......@@ -365,7 +365,6 @@ void ActiveMesh::displayMeshEdges(void)
for (unsigned int i=0; i < ID.size(); i+=3)
{
glBegin(GL_LINE_LOOP);
glNormal3f(norm[i/3].x,norm[i/3].y,norm[i/3].z);
glVertex3f(Pos[*id].x,Pos[*id].y,Pos[*id].z); ++id;
glVertex3f(Pos[*id].x,Pos[*id].y,Pos[*id].z); ++id;
glVertex3f(Pos[*id].x,Pos[*id].y,Pos[*id].z); ++id;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment