Classes | Functions

OBJ 3D Models
[3D Model Formats]

A simple reference implemenation rendering Wavefront OBJ format 3D models. More...

Collaboration diagram for OBJ 3D Models:

Classes

class  obj::Model

Functions

static smart_ptr< Model > obj::Model::create (nstream::Stream *stream, 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 (nstream::Stream *stream)
 given a stream for an OBJ material file, returns a map of name --> material

Detailed Description

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 Documentation

typedef std::map<std::string, smart_ptr<glut::Material> > obj::map_mtl_t

Definition at line 58 of file obj-material.h.


Function Documentation

smart_ptr< Model > obj::Model::create ( nstream::Stream stream,
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 ( nstream::Stream stream  ) 

given a stream for an OBJ material file, returns a map of name --> material