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

Vizualizator centres the mesh into its view centre automatically:

even when it reads STL (not just after VTK import),
the same translation is used when loading mesh after GUI request.
parent 926f99d9
No related branches found
No related tags found
No related merge requests found
......@@ -84,12 +84,12 @@ int main(int argc,char **argv)
std::cout << f << ": triangles #: " << mesh.Ftree[f].ID.size()/3 << "\n";
std::cout << f << ": normals #: " << mesh.Ftree[f].norm.size() << "\n";
}
//position the mesh with its centre aligned with the scene centre
mesh.CenterMesh();
mesh.TranslateMesh(params.sceneCentre - (mesh.meshPlaygroundSize/2.0f - mesh.meshShift));
}
//position the mesh with its centre aligned with the scene centre
mesh.CenterMesh();
mesh.TranslateMesh(params.sceneCentre - (mesh.meshPlaygroundSize/2.0f - mesh.meshShift));
//display all the meshes
initializeGL();
loopGL();
......@@ -189,6 +189,10 @@ bool LoadNewMesh(const char* path,const int ID,const int fileNo)
//remove last filopodium mesh (which is usually empty...)
mesh.DiscardLastEmptyFilopodiumObject();
//position the mesh with its centre aligned with the scene centre
//keep using the same translation (which had been determined in the main() at startup)
mesh.TranslateMesh(params.sceneCentre - (mesh.meshPlaygroundSize/2.0f - mesh.meshShift));
std::cout << "loaded mesh #" << fileNo << " (with " << filoNo-1 << " filopodia)\n";
//keep (by rotating) vertex positions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment