displayOBJ

This commit is contained in:
David Coeurjolly 2021-02-03 15:20:33 +01:00
parent 9341f71215
commit 4c6bea1008
4 changed files with 26608 additions and 7 deletions

2
.gitmodules vendored
View File

@ -2,5 +2,5 @@
path = 3-modeling/c++/deps/polyscope path = 3-modeling/c++/deps/polyscope
url = https://github.com/nmwsharp/polyscope.git url = https://github.com/nmwsharp/polyscope.git
[submodule "3-Modeling/c++/deps/geometry-central"] [submodule "3-Modeling/c++/deps/geometry-central"]
path = 3-Modeling/c++/deps/geometry-central path = 3-modeling/c++/deps/geometry-central
url = https://github.com/nmwsharp/geometry-central.git url = https://github.com/nmwsharp/geometry-central.git

26567
3-modeling/bimba.obj Executable file

File diff suppressed because it is too large Load Diff

View File

@ -56,15 +56,16 @@ endif()
# == Deps # == Deps
add_subdirectory(deps/geometry-central)
add_subdirectory(deps/polyscope) add_subdirectory(deps/polyscope)
# == Build our project stuff # == Build our project stuff
set(SRCS
simpleTest.cpp
# add any other source files here
)
# To change the name of your executable, change "gc_project" in the lines below to whatever you want
add_executable(simpleTest "${SRCS}") add_executable(simpleTest simpleTest)
target_link_libraries(simpleTest polyscope) target_link_libraries(simpleTest polyscope)
add_executable(displayOBJ displayOBJ)
target_link_libraries(displayOBJ polyscope geometry-central)

View File

@ -0,0 +1,33 @@
#include "geometrycentral/surface/manifold_surface_mesh.h"
#include "geometrycentral/surface/meshio.h"
#include "geometrycentral/surface/vertex_position_geometry.h"
#include "polyscope/polyscope.h"
#include "polyscope/surface_mesh.h"
using namespace geometrycentral;
using namespace geometrycentral::surface;
// == Geometry-central data
std::unique_ptr<ManifoldSurfaceMesh> mesh;
std::unique_ptr<VertexPositionGeometry> geometry;
int main(int argc, char **argv) {
// Initialize polyscope
polyscope::init();
// Load mesh
std::tie(mesh, geometry) = readManifoldSurfaceMesh(argv[1]);
// Register the mesh with polyscope
polyscope::registerSurfaceMesh("Input obj",
geometry->inputVertexPositions,
mesh->getFaceVertexList(),
polyscopePermutations(*mesh));
// Give control to the polyscope gui
polyscope::show();
return EXIT_SUCCESS;
}