The OBJ and MTL formats

OBJ and MTL are companion formats and often used together. The OBJ file defines the geometry, and the MTL file defines the materials that are used. Both OBJ and MTL are text-based formats. A part of an OBJ file looks as follow:

v -0.032442 0.010796 0.025935 
v -0.028519 0.013697 0.026201 
v -0.029086 0.014533 0.021409 
usemtl Material 
s 1 
f 2731 2735 2736 2732 
f 2732 2736 3043 3044 

The MTL file defines materials as follows:

newmtl Material 
Ns 56.862745 
Ka 0.000000 0.000000 0.000000 
Kd 0.360725 0.227524 0.127497 
Ks 0.010000 0.010000 0.010000 
Ni 1.000000 
d 1.000000 
illum 2 

The OBJ and MTL formats by Three.js are understood well and are also supported by Blender. So, as an alternative, you could choose to export models ...

Get Learn Three.js - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.