|
Project Information
Members
Links
|
.OBJ loader for ProcessingMaintained by SAITO and Matt Ditton (AKA Polymonkey) SAITO: http://users.design.ucla.edu/~tatsuyas/tools/objloader/index.htm Matt Ditton: http://thequietvoid.com/ Updates
DescriptionThis is Wavefront Alias .OBJ file loader for Processing. It loads .OBJ model file and renders the model onto a screen. Downloadhttp://code.google.com/p/saitoobjloader/downloads/list Installation After uncompressing the file, copy 'objloader/' folder into 'libraries/' folder which you can find under the Processing folder. Since the archive file is compressed in MacOSX environment, it might have some needless hidden files. Notice that the file you need is only 'objloader' folder and the files in the folder. The folder/file structure should be as follows.
Restart Processing. You should be able to import the objloader library from sketch menu. ReferenceThis library contains a class for loading/rendering a .OBJ file (OBJModel) and a class for accessing each vertex (Vertex) which can be primarily used to addressing vertexes in the model file and transform it. For a complete list of documentation go and check the site here. FAQ
.OBJ file is a standard 3D object file format by Alias. Alias is the leading software company of 3D graphics technology for the film, video, game development, interactive media, industrial design, automotive industry and visualization softwares. Their .OBJ ASCII file format is widely accepted all over the world as a standard format for exchanging data between 3D graphics applications. OBJ files contain solids which are made up of 3 or 4 sided faces and material data such as texture is searatedly stored in .MTL file.
.OBJ file often has a link to .MTL file, which contains material information such as texture, color and surface reflection. To use the material information, you need to add .MTL file to the project. Currently, OBJModel class supports only texture information. Texture file images (.jpg) should be added to your project too. Future updates will include support for other material information.
The first thing you should make sure is what type of polygons your model is composed of. If it is made of quads, the correct option for drawMode() is POLYGON. If it is made of triangles, drawMode(TRIANGLES) still works. drawMode(TRIANGLES) is recommended for Processing BETA 85 because of some rendering bugs (shapes drawn as POLYGONS sometimes don't show up.) More detailed info is available here (discource: Libraries, Tools - New Libraries: OBJ Loader, Google Web API ) If the model still doesn't show up, please send me the Processing source code and .OBJ model files you are trying to render. mattditton at gmail.com
To render texture, three files have to be added to your project: .OBJ file, .MTL file, texture image file. OBJModel uses standard Processing functions to render models. Inside the library, texture image is stored as PImage object, which means that the texture image file format has to be supported by PImage. Currently it supports .jpg.
Hmm.. I updated the library so that it can load models files by relative path whereever a sketch program is located. It might still have a bug. Please send me the model file and the sketch program you have a problem with. Examples
All examples can be viewed here
Etc.Bugs, opinions and complains? Please drop a line here: http://code.google.com/p/saitoobjloader/w/list |