Added .obj outputting

Changed the output format to produce .obj and .mtl files.
Renamed variables to make their purpose clearer.