Repository navigation
Conversion
mesh2gltf converts OBJ, PLY or VRML IndexedFaceSet geometry into glTF 2.0 JSON with an external .bin buffer, or into a single GLB file. Textures are referenced, copied or converted to PNG, or embedded in the GLB. The README contains the complete command reference and examples.
OBJ support includes objects and groups, polygon triangulation, authored or generated normals, UVs and vertex colors. PLY support covers ASCII and binary meshes with their normals, colors, per-vertex or per-corner UVs and TextureFile textures; point clouds are rejected. VRML support covers a subset of IndexedFaceSet scenes, rather than a full scene conversion. Unsupported data is generally omitted with a counted warning; cases that would silently place or interpret geometry incorrectly are rejected.
See Supported formats and geometry for exact coverage, smoothing, triangulation rules, PLY properties and VRML restrictions.
Large world coordinates can lose local detail when stored directly as glTF float32 values. A model far from 0 compared with its size is detected automatically: its positions are stored relative to a rounded origin, which node translations restore, so it keeps both its detail and its place. --center drops that position instead. The origin is recorded in metadata either way. Axis conversion is supported; CRS reprojection and unit conversion are not inferred.
See Georeferenced coordinates for precision, origin recovery and alignment of sibling assets.
JPG and PNG are used directly. Other supported formats are converted to PNG, which is lossless and preserves alpha. Reference/copy policy is independent of conversion; source images are never modified.
See Images for supported input formats, all image policies and conversion limits.
OBJ/MTL and VRML describe materials differently from glTF's PBR model, so appearances cannot always match exactly. Conversion maps the available color, roughness, specular, opacity and transmission parameters and retains source Phong values in metadata. Viewer support for glTF extensions affects the result.
See Materials for the mapping table, texture options and unsupported properties.
Every output follows one subset of glTF 2.0: triangle lists with float32 attributes, one buffer laid out to be read front to back (the external .bin, or the GLB's binary chunk), a flat scene and a small set of material extensions.
See Canonical glTF profile for the files, attributes, buffer layout and metadata.