.obj file loader

go back

rasterizing can be defined as a function that takes in triangles and outputs an image

 f(triangles) = image 

but where do we get the triangles from? i need a way to be able to read/write triangles onto/from a file, so that I dont have to manually write out the triangle vertices for a mesh. the simplest format is the .obj format, so i wrote a js function that takes in file as text and outputs the meshes vertices/normals/uvs/colors.

result
 { "verts": [],
            "colors": [], "uvs": [], "normals": [] }
src