diff --git a/CMakeLists.txt b/CMakeLists.txt index 30cc854..1d76645 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,8 @@ SET(CMAKE_CXX_STANDARD 11) option(TINYGLTF_BUILD_LOADER_EXAMPLE "Build loader_example" ON) option(TINYGLTF_BUILD_GL_EXAMPLES "Build GL exampels(requires glfw, OpenGL, etc)" OFF) -option(TINYGLTF_BUILD_VALIDATOR_EXAMPLE "Build validator exampe" OFF) +option(TINYGLTF_BUILD_VALIDATOR_EXAMPLE "Build validator example" OFF) +option(TINYGLTF_BUILD_BUILDER_EXAMPLE "Build glTF builder example" OFF) if (TINYGLTF_BUILD_LOADER_EXAMPLE) ADD_EXECUTABLE ( loader_example @@ -22,6 +23,11 @@ endif (TINYGLTF_BUILD_GL_EXAMPLES) if (TINYGLTF_BUILD_VALIDATOR_EXAMPLE) ADD_SUBDIRECTORY ( examples/validator ) endif (TINYGLTF_BUILD_VALIDATOR_EXAMPLE) + +if (TINYGLTF_BUILD_BUILDER_EXAMPLE) + ADD_SUBDIRECTORY ( examples/build-gltf ) +endif (TINYGLTF_BUILD_BUILDER_EXAMPLE) + # # TinuGLTF is a header-only library, so no library build. just install header files. # diff --git a/README.md b/README.md index 751f977..6d215a3 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ In extension(`ExtensionMap`), JSON number value is parsed as int or float(number * [glview](examples/glview) : Simple glTF geometry viewer. * [validator](examples/validator) : Simple glTF validator with JSON schema. * [basic](examples/basic) : Basic glTF viewer with texturing support. +* [build-gltf](examples/build-gltf) : Build simple glTF scene from a scratch. ## Projects using TinyGLTF diff --git a/examples/build-gltf/Makefile b/examples/build-gltf/Makefile new file mode 100644 index 0000000..51c22f5 --- /dev/null +++ b/examples/build-gltf/Makefile @@ -0,0 +1,2 @@ +all: + $(CXX) -o create_triangle_gltf -I../../ create_triangle_gltf.cpp