---
title: "How to convert OBJ to GLB | Spatial Compiler"
description: "Convert OBJ to GLB by importing the .obj with its .mtl and textures, setting the size (OBJ has no units), rebuilding the material as PBR, exporting .glb."
canonical: https://appliedmanifold.com/mesh/convert-obj-to-glb/
site: "Applied Manifold: The spatial compute cloud for 3D reality"
---

1.  [Home](https://appliedmanifold.com/)
2.  [meshfx](https://appliedmanifold.com/mesh/)
3.  OBJ to GLB

meshfx // CONVERT // OBJ TO GLB

# How to convert an OBJ file to GLB

You convert OBJ to GLB by importing the .obj with its .mtl file and textures into a 3D editor, setting the size yourself (OBJ has no units), rebuilding the material as PBR, and exporting glTF 2.0 (.glb). Keep the .obj, .mtl and texture files in one folder first, or the textures will not load.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [meshfx docs →](https://appliedmanifold.com/docs/mesh/)

pyrofx effects work today, and new accounts start with $5 of usage.

**MODULE // meshfx AVAILABLE**

meshfx measures faults, checks repairs and makes LODs for a triangle budget. meshfx runs on the hosted API: try it in the [Playground](https://appliedmanifold.com/playground/).

-   OBJ has no units or pivots
-   Materials live in the .mtl file
-   No animation to carry over

01 // WHAT CHANGES

## What OBJ leaves out

-   OBJ stores plain numbers with no unit, so the same file can mean meters, centimeters or inches. GLB is in meters, so you decide the scale at import.
-   OBJ has no objects with their own position or pivot, because the vertex coordinates are the pivot. Set origins in your editor before export so each GLB node has a sensible pivot.
-   The .mtl file holds old-style color, specular and shininess values plus texture paths, while GLB wants base color, metallic and roughness, so you rebuild the material.
-   An OBJ may or may not include normals (the `vn` lines), and without them the model shades faceted until you smooth it.
-   OBJ has no animation, so there is nothing to carry over.

02 // BY HAND

## Convert it by hand

1.  Put the .obj, .mtl and textures in one folder, open the .mtl in a text editor, and change any absolute texture paths to plain file names.
2.  Import the OBJ into Blender or your 3D editor and scale it to real size next to a 1 m cube.
3.  Join or separate objects the way you want them in your scene, and set each origin.
4.  Turn on smooth shading with a smoothing angle if the model came in faceted.
5.  Rebuild each material as PBR, with base color from the `map_Kd` texture and roughness and metallic as values or maps.
6.  Export glTF 2.0 as glTF Binary (.glb) and check it in a glTF viewer or your engine.

03 // MTL FILES

## Read the .mtl before you import

Most missing-texture problems with OBJ start in the .mtl file. It is plain text, and each material lists its textures on lines such as `map_Kd wood.png` for color and `map_Bump wood_n.png` for bump or normal detail. If those lines point at a drive letter or a folder on someone else's computer, the importer finds nothing and the model loads gray.

04 // meshfx

## meshfx for obj to glb

meshfx measures holes, flipped faces and non-manifold edges. Each repair is checked against the source and undone with a warning if it moves the surface too far. Hosted meshfx runs are available in the Playground.

05 // RELATED

## Related pages

-   [glTF and GLB AvailableglTF is an open 3D format for meshes, materials and animation, and GLB is the same data packed into one binary file.](https://appliedmanifold.com/learn/glb-gltf/)
-   [FBX to GLB AvailableConvert an FBX file to GLB by hand, and what changes on the way: units, axes, materials, n-gons and animation.](https://appliedmanifold.com/mesh/convert-fbx-to-glb/)
-   [USD to GLB AvailableConvert a USD stage to GLB by hand, and handle what changes: metersPerUnit, upAxis, winding, n-gons, materials and variants.](https://appliedmanifold.com/mesh/convert-usd-to-glb/)
-   [OBJ scale AvailableOBJ has no unit, so read its vertex values, scale the model to real size and set the export or import scale yourself.](https://appliedmanifold.com/mesh/fix-model-scale-obj/)
-   [OBJ pivot AvailableAn OBJ pivot is always the file origin, so move the model to 0, 0, 0 before export or switch to GLB.](https://appliedmanifold.com/mesh/fix-pivot-point-obj/)
-   [LOD in three.js AvailableBuild LOD in three.js with THREE.LOD and addLevel, stop flicker with hysteresis, and keep the extra levels light for the download.](https://appliedmanifold.com/mesh/lod-threejs/)
-   [meshfxmeshfx reads an input model, repairs surface faults and compiles reduced GLB levels of detail for Godot, three.js or any glTF loader.](https://appliedmanifold.com/docs/mesh/)

[All pages in meshfx →](https://appliedmanifold.com/mesh/)

[← FBX to GLB](https://appliedmanifold.com/mesh/convert-fbx-to-glb/)[GLB to FBX →](https://appliedmanifold.com/mesh/convert-glb-to-fbx/)

06 // FAQ

## OBJ to GLB questions

[All questions →](https://appliedmanifold.com/faq/)

**README.CONVERT\_OBJ\_TO\_GLB**

### How do I load a glTF model in three.js?

Use GLTFLoader to load the file and add gltf.scene to your scene, attaching DRACOLoader first if the geometry uses Draco compression.

### Does OBJLoader in three.js handle ngons?

Yes, it splits faces with more than three corners into a fan of triangles, which breaks concave faces. Triangulate in your 3D editor first.

### How do I fix incorrect object scale before exporting an OBJ?

Scale the model to its real size, apply the scale and set the OBJ exporter scale field so one file unit matches one engine unit.

### Why does my OBJ look black in three.js?

Its `vn` normals point inward or are missing. Export again with corrected normals or call `geometry.computeVertexNormals()` on each mesh after OBJLoader loads it.

## Explore meshfx outputs

Inspect compiled meshfx outputs and their reports. Hosted meshfx runs are available in the Playground.

[Get Free API Key](https://console.appliedmanifold.com/sign-in?next=/api-keys) [meshfx →](https://appliedmanifold.com/docs/mesh/)

[All effects, guides and explainers →](https://appliedmanifold.com/effects/)
