A detailed explanation of the .obj and .mtl file formats
obj file is a 3D model file format. A standard developed by Alias|Wavefront for the 3D modeling and animation software “Advanced Visualizer”, suitable for mutual guidance between 3D software models, and can also be read and written through Maya. Only supports model triangle surface data and material information, no animation support; The geometric information is provided by the .obj file, and the material information is defined by the .mtl file; The file represents a piece of data in line units, and the subsequent content can be judged according to the characters at the beginning of the line; The # character represents a comment line Note: For .obj and .mtl parsing and loading, please refer to:Loading .obj and .mtl in opengl es 2.0 OBJ format # material file corresponding to obj# mtllib testvt.mtl# group nameg default# o object name(Object name)o testvt.obj # verticesv -0.5 -0.5 0.1v -0.5 -0.5 -0.1v 0 0.5 0.1v 0 0.5 -0.1v 0.5 -0.5 0.1 v 0.5 -0.5 -0.1# texture coordinatesvt 0 1vt 1 1vt 0.5 0# vertex normalvn 0 0 1vn 0 0 -1# The material used by the current primitiveusemtl Default# s Smooth shading across polygons is enabled by smoothing groups.# Smooth shading can be disabled…