diff --git a/docs/guides/OBJ_FILES_WITH_METADATA.md b/docs/guides/OBJ_FILES_WITH_METADATA.md new file mode 100644 index 0000000..7a1370b --- /dev/null +++ b/docs/guides/OBJ_FILES_WITH_METADATA.md @@ -0,0 +1,41 @@ +# OBJ Files with Metadata + +This guide will show you how to encode and render Draco files encoded from OBJ files with metadata. + + +## Render three.js Example + +Check out the three.js branch that has support for loading Draco files with metadata. + +``` +git clone git@github.com:FrankGalligan/three.js.git +cd three.js +git checkout render_draco_with_metadata +``` + +Render the sample Draco file with metadata. + +``` +python -m SimpleHTTPServer +``` + +Open `http://localhost:8000/examples/webgl_loader_draco_with_mat.html` in the browser. You should see a spinning cube with different color faces. + +## Encode Draco File with Metadata + +Encode a mesh file using the default encode settings with metadata. The input to `draco_encoder` must be an OBJ file that contains metadata. The `--metadata` command line option must be set: +``` +./draco_encoder -i .obj --metadata -o .drc +``` + +## Render Encoded Draco File with Metadata + +Open `examples/webgl_loader_draco_with_mat.html` and replace `mat_cube.drc` with `.drc`. + +Render your Draco file with metadata. + +``` +python -m SimpleHTTPServer +``` + +Open `http://localhost:8000/examples/webgl_loader_draco_with_mat.html` in the browser. You should see your encoded Draco file. diff --git a/docs/guides/README.md b/docs/guides/README.md index 1c7e874..bd0cb5b 100644 --- a/docs/guides/README.md +++ b/docs/guides/README.md @@ -8,6 +8,10 @@ * [Browser](BROWSER.md) * [JavaScript Decode](BROWSER.md#JavaScript-Decode-Draco-File) * [Basic Three.js Render](../../javascript/example/README.md) + * [Obj Files with Metadata](OBJ_FILES_WITH_METADATA.md) + * [Render three.js Example] (OBJ_FILES_WITH_METADATA.md#Render-three.js-Example) + * [Encode Draco File with Metadata] (OBJ_FILES_WITH_METADATA.md#Encode-Draco-File-with-Metadata) + * [Render Encoded Draco File with Metadata] (OBJ_FILES_WITH_METADATA.md#Render-Encoded-Draco-File-with-Metadata) ## [glTF](GLTF.md) * [glTF to Draco glTF Using gltf-pipeline](GLTF.md#Encode-Draco-glTF-Using-gltf-pipeline)