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.
IndexProcessing DevelopmentLibraries,  Tool Development › New Libraries: OBJ Loader, Google Web API
Pages: 1 2 3 
New Libraries: OBJ Loader, Google Web API (Read 19163 times)
New Libraries: OBJ Loader, Google Web API
May 2nd, 2005, 3:58am
 
as you may know, I made new libraries for Processing (OBJ Loader and Google Web API).
http://processing.org/reference/libraries/index.html

I am currently working on documenting how to map dynamic video texture on .OBJ model using Capture class...

I am very curious for what unexpected purpose people use them and what 'evolution' those libraries go through...
Let me know if somebody is using the libraries for an interesting project.
I also want to fix hidden bugs and need help for this.
Any comments and suggestions are welcome!

Thank you!
Re: new libraries ads
Reply #1 - May 3rd, 2005, 6:58pm
 
Thank you very much for these libraries! I'm looking forward to seeing how they are used...
Re: new libraries ads
Reply #2 - May 4th, 2005, 6:17am
 
oooooooo, exciting!  can't wait to mess...thanks saito!
Re: New Libraries: OBJ Loader, Google Web API
Reply #3 - May 4th, 2005, 7:40pm
 
I've jsut had a quick play with OBJ loader, and hit a small snag.

The program I use to create OBJ files uses 'o' for "object" instead of 'g' for group it seems.

I found this out because it threw a parse error with the original object, and drew nothing when I removed the "o 1" line. I managed to guess to change it to 'g' after looking at the debuginfo.

I've no idea which is right.
Re: New Libraries: OBJ Loader, Google Web API
Reply #4 - May 5th, 2005, 3:25am
 
Thanks JohnG,

it is great help for me to do bug fix.
a different application software outputs a slightly different file.
what software are you using?
also, it would be great if you can send me the model file to test.
i am writinng the new version and it already handles "o" and "g".

thank you!
Re: New Libraries: OBJ Loader, Google Web API
Reply #5 - May 5th, 2005, 5:26am
 
OK. I just fixed some known OBJ loader bugs.
The new version is available here: http://users.design.ucla.edu/~tatsuyas/tools/objloader/index.htm

Because of a bug in triangulation function in Processing, some polygons are not correctly rendered. (It is not the loader bug Smiley
In some cases, drawMode(TRIANGLES) sometimes does the trick.

If you get problems with polygon rendering, please try the sample program on my site: http://users.design.ucla.edu/~tatsuyas/tools/objloader/OBJLoader_Sample.zip

With this program, you can easily  change renderig mode by hitting keys. It will be a nice tool to scrutinize the problem.
In case you want to report a bug to me, please give me the info about in what situation you get the problem...

Thanks !!!
Re: New Libraries: OBJ Loader, Google Web API
Reply #6 - May 5th, 2005, 5:34am
 
One more thing.
As posted in the following topic, Processing seems to have a bug in the triangulation function.

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1114158993

If you have problem with drawMode(POLYGON), try to triangluate all the polygons with your modeling software and do drawModel(TRIANGLES). As far as I know, in most cases, this works.
Re: New Libraries: OBJ Loader, Google Web API
Reply #7 - May 5th, 2005, 6:34am
 
Hi Saito,

Thanks for your speedy response and code update! I can get a model loaded now from Blender. However, even though I have changed all the faces to triangles, I still get some transparent faces.

My source files are at:
http://www.uncannykid.com/sicube.zip
Re: New Libraries: OBJ Loader, Google Web API
Reply #8 - May 5th, 2005, 7:50am
 
Hmm.
I looked inside the .OBJ file and found that there most of the facets are quads. Each line specifies 4 points, each of which consists of indexes for vertex, texture coordinates and normal vertex.

f 4/1/1 1/2/2 2/3/3 3/4/4
f 8/5/5 7/6/6 6/7/7 5/8/8
f 12/9/9 10/10/10 9/11/11 11/12/12
f 16/13/13 14/14/14 13/15/15 15/16/16
f 18/17/17 20/18/18 19/19/19 17/20/20
f 24/21/21 22/22/22 21/23/23 23/24/24

It seems like your program didn't triangulate.

The sample program on my website might be helpful.
If you see quad strokes, that means the model is not triangulated.

Hope this is helpful for you...
Re: New Libraries: OBJ Loader, Google Web API
Reply #9 - May 9th, 2005, 12:24am
 
Thanks I've got it working now. How do materials and textures work? I assume this information is held in the file with same name but .MTL extension. I can load up this greenstar model fine but the simple green material won't load.

http://www.uncannykid.com/greenstar.zip

-Matt
Re: New Libraries: OBJ Loader, Google Web API
Reply #10 - May 9th, 2005, 6:09am
 
I actually changed the code so that the library loads Kd and Ka elements in .mtl and later noticed that it doesn't work well in a certain situation.

It seems like that if you make a model and doesn't set the the material info such as color, material elements in .mtl file usually say "0.0 0.0 0.0".
If you apply texture onto the model, you can see the textured model on your application, but on Processing, it shows just black model without texture because of the zero values.
I thought it is kind of confusing for beginners and just decided to support alpha value so far.

Maybe the library should load .mtl files as is and I should say that material elements have to be non-zero value even if it is textured in FAQ or reference.. I will work on this soon..

mfischler wrote on May 9th, 2005, 12:24am:
Thanks I've got it working now. How do materials and textures work I assume this information is held in the file with same name but .MTL extension. I can load up this greenstar model fine but the simple green material won't load.

http://www.uncannykid.com/greenstar.zip

-Matt

Re: New Libraries: OBJ Loader, Google Web API
Reply #11 - May 25th, 2005, 2:24am
 
http://ingallian.design.uqam.ca/goo/P55/ObjTest/

Thanks for the OBJ importer! It would be usefull for many purposes. I like to work with ASCII readable formats, as OBJ is.

I tried the OBJLoader. I tried different ways to export my geometry in my modeler, as dividing concave faces, as parametrics properties and to triangulate in different ways.

In the example, If you try the [key 6]-QUADS mode, it will give a better representation of the form. It's ok because I have just 4Points Faces. But it won't work with the original face (without the subdivision). With [key 4]-POLYGON, no matter if I subdivide Concave faces, I got missing faces. I want to avoid Triangulations because it's less clean when used with stroke representation.
Is it because there's restriction about how the faces must be formed?
Re: New Libraries: OBJ Loader, Google Web API
Reply #12 - May 28th, 2005, 10:27pm
 
Hey Saito,

I have been trying to use the OBJLoader library to creat 3D animations, and I was wondering if it was possible to creat an OBJModel array. I was able to creat an array, but I couldn't figure out how to access member functions.

Also I couldn't seem to creat a OBJModel in a class, and this seemed to be caused by the (this) input. What porpose does it serve in the OBJModel creator?
Re: New Libraries: OBJ Loader, Google Web API
Reply #13 - Jun 1st, 2005, 5:01pm
 
Could we load in proce55ing 3D projects with instances handling (The same object is repeated many times - Block equivalent in AutoCAD) and group descriptions? For example, I have a wall to import wich is composed of many repetitives objects.
As I saw, OBJ File Format do not support it (grouping exist but there's no instances).Could we have instances with OBJ or there's a way that I didn't saw?
parameters from .obj_files
Reply #14 - Jun 10th, 2005, 11:37pm
 
hello Saito,
i'd like to use vertex parameters from .obj_files to transform objects. is it possible to adress the values directly from processing. i could pars the file, but than i have the problem of drawing the shapes by connecting the right vertex.
jan peter
Pages: 1 2 3