File Exchange

image thumbnail


version (1.68 KB) by Bernard Abayowa
readObj file into Matlab structure


Updated 28 Feb 2008

View License

This function reads vertices, faces, texture and normal information from a specified Obj file, and stores the information in a Matlab structure. This file is designed for faces with 3 vertices (Triangulated mesh).

Cite As

Bernard Abayowa (2020). readObj (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (12)

i dont have readObj in my toolbox how can i add it ? thank you for help

chaolu yuan


For making it work with arbitrary number of vertexes do the following change:
% f.v = [f.v; fv]; f.vt = [f.vt; fvt]; = [; fvn];
f.v{p} = fv;
f.vt{p} = fvt;{p} = fvn;
p = p + 1;


It meet bug when I use face data like

f 531//1262 534//1265 539//1218

simply work!
Thank you very much...

Neat. Works well.


Binh Nguyen

Simple and efficient code. Note that the code work with faces with arbitrary number of vertices also (not just 3 like the author's description).

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux