A simple reference implemenation rendering Wavefront OBJ format 3D models. More...
Classes | |
class | obj::Model |
Functions | |
static smart_ptr< Model > | obj::Model::create (IN nstream::Stream *stream, IN float scale) |
loads an OBJ scene object (aiScene) which can render itself | |
| |
typedef std::map< std::string, smart_ptr< glut::Material > > | obj::map_mtl_t |
map_mtl_t | obj::parseOBJMaterials (IN nstream::Stream *stream) |
given a stream for an OBJ material file, returns a map of name --> material |
A simple reference implemenation rendering Wavefront OBJ format 3D models.
See http://en.wikipedia.org/wiki/Obj
The Open Asset Library implementation also supports OBJ, but there are a few issues there:
OBJ is simple enough so this is a quick reference implementation.
A note to users of this model: in the interest of rendering performance, vertex data is copied per vertex. That is, it is not indexed per vertex, but instead the vertex data (including normals etc) is copied.
So if you have a large model with a lot of shared vertices, this approach could be too memory intensive.
typedef std::map<std::string, smart_ptr<glut::Material> > obj::map_mtl_t |
Definition at line 58 of file obj-material.h.
smart_ptr< Model > obj::Model::create | ( | IN nstream::Stream * | stream, | |
IN float | scale | |||
) | [static, inherited] |
loads an OBJ scene object (aiScene) which can render itself
Definition at line 596 of file obj-model.cpp.
map_mtl_t obj::parseOBJMaterials | ( | IN nstream::Stream * | stream | ) |
given a stream for an OBJ material file, returns a map of name --> material