We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › objLoader hits version 015
Page Index Toggle Pages: 1
objLoader hits version 015 (Read 1174 times)
objLoader hits version 015
Apr 17th, 2009, 12:25pm
 
I've posted an update to the objloader up on the google code site here
http://code.google.com/p/saitoobjloader/downloads/list

This version contains the following fixes and features

- The Kd settings are now used for the fill()
- Ka and Ks are now used in the processing ambient() and specular()
- The loading of obj and mtl files has been adjusted to help address the problems of online support
- Verts, Normals and UV's are now stored in the PVector object.

The final change does make this a v1.0 and above only release. I've altered the examples on the page to reflect these changes. But the simple example is when you would previously do this

Vertex v = model.getVertex(i);

now you do this

PVector v = model.getVertex(i);

there are also new methods including

model.getNormal(i);
model.getUV(i);

I've also changed the way that vert's normals and uv's are gotten from the library. The new method is a little more memory efficient as it passes back a reference to the original PVector, rather than creating a new PVector.

In addition there are two new features that I'm in the process of documenting and getting example together. They are the new objTools library and series of methods within the objLoader to expose access to the faces of a model, or specifically the indexes to the verts, normals and uv's arrays that make up the face.

objTools contains methods for getting the bounding box of a model and for doing simple scaling and transformations.

Having done all this I realize now that I may have to go back and adjust the drawOPENGL() method to support the updating of verts in the faster OPENGL mode. But all in good time.

If you've got any comments or questions, please drop me a line.

MattD
Re: objLoader hits version 015
Reply #1 - Apr 27th, 2010, 8:02am
 
Hi -

First, thanks for this library!

Sorry if this is a basic question, but I am unable to run the examples in the OBJLoader package (for example, OBJLoader_Faces_MATTD), because I do not have the OBJTools package.  ("The package "saito.objtools" does not exist.  You might be missing a library.")

When I try running the "OBJLoader_Faces" example without loading the objtools library, Processing does not recognize functions such as enableDebug().  I am able to run others scripts that use only the OBJLoader functions.  However I would like to be able to access the OBJTools functions as well.

I have searched the forum, the Google Code site, and the full package downloaded from ekeneijeoma.com, but I can not find a separate objtools library.

Could you help me access this library?  Again - sorry if this is basic.

B
Re: objLoader hits version 015
Reply #2 - Apr 27th, 2010, 10:42am
 
I discovered that not all of the objloader.jar files out there include the objtools library.  The one provided at http://ekeneijeoma.com/processing/objloader/ does not include that library.  However, the file available at googlecode does -- which is the one I was supposed to use, so my bad.

I replaced my library with the one from googlecode, and the example scripts are now loading both saito.objloader and saito.objtools.

However, processing continues to not recognize some of the classes and functions in the example scripts.  For example, when I run "OBJLoader_Sample_SAITO" I get an error message "Cannot find a class or type named "BoundingBox".  When I run "OBJLoader_Sample_MATTD" I get error messages stating that the "enableDebug()", "shapeMode()", and "setupGL()" functions do not exist.

A simple script that relies only on OBJModel, load(), draw(), and drawMode continues to work fine.  I don't know why Processing is able to recognize those terms but not the others listed above.

I am running the example scripts from the package provided at googlecode.  I am running Processing 1.1, but I have tried reverting to 1.0.9 and receive the same error messages.  I am use OSX 10.5.8.  I am able to run the example scripts as java applets.

Judging from my track record, there is probably a simple explanation for this.  Please help if you know what it is!

B
Page Index Toggle Pages: 1