
What the GLB keeps, and what it loses
| In the GLB | |
|---|---|
| Shape | Every triangle, with its corners shared. Faces with more corners are cut into triangles |
| Colors | A material for each color of the material file, up to 32. More than that, as from a scan, as the colors of the vertices |
| Shading | The OBJ's normals, when every corner has one |
| Size | Meters, from the unit you choose for the OBJ |
| Which way up | Y up, as the model stands on screen |
| Object and group names | Lost: a mesh for each color instead |
| Textures | Lost |
How to convert an OBJ to GLB
- Drop the OBJ on this page with its material file, or a ZIP of its folder, or choose them with the button. They are read in your browser; nothing is uploaded.
- Look at the model in its colors. If it lies on its back, choose Z points up in the Views menu.
- Under Units, choose the unit the model was drawn in.
- Choose Download GLB. The file is named after the OBJ:
lamp.objbecomeslamp.glb.
Colors and materials
An OBJ keeps its colors in a material file that it names on a mtllib line. Each material has a diffuse color (Kd), and each face of the OBJ says which material it is in. The converter gives the GLB a material for each color that the faces use, and puts the faces of each color in a mesh of their own, so a program that opens the GLB can change one color without the others. The material is matte, with no metal in it, which is what a diffuse color describes.
A material file can also name pictures, for the color, the bumps or the shine of a surface. Those are not read: the GLB has the materials’ colors only. An OBJ may also give a color with each vertex, as scanners write it; such colors are kept, as materials when there are few and otherwise as the colors of the GLB’s vertices.
Size and orientation
glTF is in meters with Y up, and every program that reads a GLB knows it, so a GLB arrives at its real size and the right way up without a setting. An OBJ states neither. The converter takes the unit you choose under Units and the way up you see in the viewer, and writes the GLB from them: a part 80 mm long is 0.08 in the GLB, and a program that shows it in centimeters says 8 cm.
GLB, glTF or OBJ
- GLB is one file, for a web page, AR on Android, or a game engine such as Godot.
- glTF is the same as text, with its geometry in a
.binfile beside it, for editing by hand or by script. - OBJ stays the format nearly every older program reads.
The STL, 3MF, glTF and PLY are saved from the links under the button.
Questions
Is my file uploaded?
No. The OBJ and its material file are read and the GLB is written by your own browser. Nothing is sent to a server.
How do I keep the colors?
Drop the OBJ together with its material file (.mtl), or a ZIP of the folder they are in. The panel says when the OBJ names a material file that was not dropped with it. Each color becomes a material of the GLB.
Are the textures kept?
No. The materials' colors are, but not the pictures an OBJ's material file names, which this page does not read yet. A model whose look is all in its texture arrives in its materials' plain colors.
What size is the GLB?
The real size, in meters, which is the unit glTF uses. An OBJ has no unit of its own, so choose the one it was drawn in under Units: a model in millimeters becomes a GLB a thousand times smaller in number and the same size in the world.
Which way up is it?
As the model stands in the viewer, which takes an OBJ to stand on Y, as glTF does. An OBJ from a CAD program may stand on Z: choose Z points up in the Views menu, and the GLB is turned to stand on Y.
Are the object names kept?
No. Each color becomes a mesh of its own in the GLB, named after the file with a number for each color, and the names of the OBJ's objects and groups are not kept.