GLTF support for Mittsu.
Just install:
bundle add mittsu-gltf
Then require in your code:
require 'mittsu/gltf'
Currently this gem just includes an exporter. Loading GLTF files might happen at some point.
exporter = Mittsu::GLTFExporter.new
exporter.export(object, "output.gltf")
You can also write binary files for simple single-mesh models:
exporter.export(object, "output.glb", mode: :binary)
The binary GLTF exporter can create "progressive meshes" using the proposed
MANYFOLD_mesh_progressive
GLTF extension. If you want to create these sort of meshes, you will need to install
the mittsu-mesh_analysis
gem and create a Mittsu::MeshAnalysis::ProgressiveMesh
object, which you can
then pass to export
in the same way as above.
This code was originally written for Manyfold, supported by funding from NLNet and NGI Zero.