diff --git a/tutorial/100_FileIO/cube.obj b/tutorial/100_FileIO/cube.obj deleted file mode 100644 index 9e8624c62..000000000 --- a/tutorial/100_FileIO/cube.obj +++ /dev/null @@ -1,14 +0,0 @@ -v 1 0 1 -v 0 1 1 -v -1 0 1 -v 0 -1 1 -v 1 0 -1 -v 0 1 -1 -v -1 0 -1 -v 0 -1 -1 -f 1 2 3 -f 8 5 1 -f 5 6 2 -f 6 7 3 -f 4 3 7 -f 7 6 5 diff --git a/tutorial/100_FileIO/main.cpp b/tutorial/100_FileIO/main.cpp index d1ad52292..52cc95169 100755 --- a/tutorial/100_FileIO/main.cpp +++ b/tutorial/100_FileIO/main.cpp @@ -9,7 +9,7 @@ Eigen::MatrixXi F; int main(int argc, char *argv[]) { // Load a mesh in OFF format - igl::readOFF("cube.off", V, F); + igl::readOFF("../shared/cube.off", V, F); // Plot the vertices and faces matrices std::cerr << "Vertices: " << std::endl << V << std::endl; diff --git a/tutorial/102_DrawMesh/bunny.off.REMOVED.git-id b/tutorial/102_DrawMesh/bunny.off.REMOVED.git-id deleted file mode 100644 index b3a817357..000000000 --- a/tutorial/102_DrawMesh/bunny.off.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a9f6cb63faaebfecf28f1fe317cc9a3e0ee9b0de \ No newline at end of file diff --git a/tutorial/102_DrawMesh/main.cpp b/tutorial/102_DrawMesh/main.cpp index 84e1abc35..240303807 100755 --- a/tutorial/102_DrawMesh/main.cpp +++ b/tutorial/102_DrawMesh/main.cpp @@ -8,7 +8,7 @@ Eigen::MatrixXi F; int main(int argc, char *argv[]) { // Load a mesh in OFF format - igl::readOFF("bunny.off", V, F); + igl::readOFF("../shared/bunny.off", V, F); // Plot the mesh igl::Viewer viewer; diff --git a/tutorial/103_Events/main.cpp b/tutorial/103_Events/main.cpp index 2b782945e..4ae1fe150 100755 --- a/tutorial/103_Events/main.cpp +++ b/tutorial/103_Events/main.cpp @@ -30,8 +30,8 @@ bool key_down(igl::Viewer& viewer, unsigned char key, int modifier) int main(int argc, char *argv[]) { // Load two meshes - igl::readOFF("bumpy.off", V1, F1); - igl::readOFF("fertility.off", V2, F2); + igl::readOFF("../shared/bumpy.off", V1, F1); + igl::readOFF("../shared/fertility.off", V2, F2); igl::Viewer viewer; // Register a keyboard callback that allows to switch between diff --git a/tutorial/104_Overlays/bunny.off.REMOVED.git-id b/tutorial/104_Overlays/bunny.off.REMOVED.git-id deleted file mode 100644 index b3a817357..000000000 --- a/tutorial/104_Overlays/bunny.off.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -a9f6cb63faaebfecf28f1fe317cc9a3e0ee9b0de \ No newline at end of file diff --git a/tutorial/104_Overlays/main.cpp b/tutorial/104_Overlays/main.cpp index 0ce727c29..15e12e896 100755 --- a/tutorial/104_Overlays/main.cpp +++ b/tutorial/104_Overlays/main.cpp @@ -9,7 +9,7 @@ Eigen::MatrixXi F; int main(int argc, char *argv[]) { // Load a mesh in OFF format - igl::readOFF("bunny.off", V, F); + igl::readOFF("../shared/bunny.off", V, F); // Find the bounding box Eigen::Vector3d m = V.colwise().minCoeff(); @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) std::stringstream l2; l2 << M(0) << ", " << M(1) << ", " << M(2); viewer.draw_label(M,l2.str()); - + // Launch the viewer viewer.launch(); } diff --git a/tutorial/105_Colors/CMakeLists.txt b/tutorial/105_Colors/CMakeLists.txt new file mode 100644 index 000000000..c9a9644fb --- /dev/null +++ b/tutorial/105_Colors/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 2.6) +project(105_Colors) + +include("../CMakeLists.shared") + +set(SOURCES +${PROJECT_SOURCE_DIR}/main.cpp +) + +add_executable(105_Colors ${SOURCES} ${SHARED_SOURCES}) +target_link_libraries(105_Colors ${SHARED_LIBRARIES}) diff --git a/tutorial/105_Colors/main.cpp b/tutorial/105_Colors/main.cpp new file mode 100755 index 000000000..ac6541bc4 --- /dev/null +++ b/tutorial/105_Colors/main.cpp @@ -0,0 +1,37 @@ +#define IGL_HEADER_ONLY +#include +#include +#include + +Eigen::MatrixXd V; +Eigen::MatrixXi F; + +int main(int argc, char *argv[]) +{ + // Load a mesh in OFF format + igl::readOFF("../shared/screwdriver.off", V, F); + + // Plot the mesh + igl::Viewer viewer; + viewer.draw_mesh(V, F); + + + // Normalize x coordinate between 0 and 1 + Eigen::VectorXd value = V.col(0).array() - V.col(0).minCoeff(); + value = value.array() / value.maxCoeff(); + + // Map to colors using jet colorramp + Eigen::MatrixXd C(V.rows(),3); + for (unsigned i=0; i