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 19164 times)
Re: New Libraries: OBJ Loader, Google Web API
Reply #15 - Jun 18th, 2005, 4:52pm
 
Hmm.. I just tried array definition of OBJModel and it worked.
It would be great if you can give me the source code which does not work in your environment.

this is what i tried for loading a sequence of models.

OBJModel[] models;

models = new OBJModel[10];
for(int i = 0; i < models.length; i++){
 models[i] = new OBJModel(this);
 models[i].debugMode();
 models[i].load("sample"+i+".obj");
}


BlueNinja wrote on 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 #16 - Jun 18th, 2005, 5:00pm
 
As long as checked, I could not find a way to define instances in .obj files...
I could extend my loader to have a proprietary option to be able to handle instance definitions.
But, in that case, you still have to write .obj by hand because there is no application software able to handle this proprietary option..
It reduces the size of a model file containing repetitive use of a same shape and probably makes it a bit faster to run on Processing.
So, for now, it would be better to make one independent .obj file for drawing repetitive objects.
A loader for a scene graph may be what is in charge of instance definition. If it's not so hard to write a scene graph loader, I might try to implement it...

gll wrote on 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

Re: parameters from .obj_files
Reply #17 - Jun 18th, 2005, 6:08pm
 
Sorry for getting back to you late.
I just updated the library (now rev.07)
http://users.design.ucla.edu/~tatsuyas/tools/objloader/index.htm

the library now has two functions, getVertex() and setVertex(), which allow you to address and change each vertex. Please check the example project.
There might be a better way to transform an object.. Let me know if you have an idea..


jan_peter wrote on 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

getvertex(), getVertexsize
Reply #18 - Jun 19th, 2005, 6:19pm
 
hi SAITO,

yesterday i wrote a simple parser which makes it possible to transform .obj_files. because of the number of used variables it only works with 8 vertex. i was very happy to find your response today. i tested it and i'm really amazed. i will add it to the sketch i'm working on. i'll tell you more later.

—jan
Re: New Libraries: OBJ Loader, Google Web API
Reply #19 - Jun 21st, 2005, 7:15am
 
SAITO wrote on Jun 18th, 2005, 5:00pm:
A loader for a scene graph may be what is in charge of instance definition. If it's not so hard to write a scene graph loader, I might try to implement it...


I tried to write something like a sceneGraph handler. I just realize that there's so much different ways to do it and it would depend on the goals.

I studied different 3D formats. IGES should be a great candidate, but there's a lot of things to support (Complex curves, complex faces mesh, solid primitives). The layering and instanciation is supported. In other way, it's not readable as the .OBJ are.
Re: New Libraries: OBJ Loader, Google Web API
Reply #20 - Jul 1st, 2005, 11:13am
 
I always get the following error when loading OBJ files exported from 3ds max 7...

java.lang.ArrayIndexOutOfBoundsException: -26
at java.util.Vector.elementAt(Unknown Source)

here's the link to the compressed OBJ MTL and texture files .. http://bituman.ftp.icd.hu/obj/obj.rar .. maybe someone can point out where i make a mistake.

PS: the code to load and display the object is the ObjLoader example program, i havent altered it, except for the model file name.
Re: New Libraries: OBJ Loader, Google Web API
Reply #21 - Jul 16th, 2005, 3:44am
 
I checked the .obj file and found the following part.
facets indexes are specified by negative values.

usemtl boards04
s 1
f -25/-25/-25 -24/-24/-24 -19/-19/-19 -20/-20/-20
f -24/-24/-24 -23/-23/-23 -18/-18/-18 -19/-19/-19
f -23/-23/-23 -22/-22/-22 -17/-17/-17 -18/-18/-18
f -22/-22/-22 -21/-21/-21 -16/-16/-16 -17/-17/-17
f -20/-20/-20 -19/-19/-19 -14/-14/-14 -15/-15/-15
f -19/-19/-19 -18/-18/-18 -13/-13/-13 -14/-14/-14
f -18/-18/-18 -17/-17/-17 -12/-12/-12 -13/-13/-13
f -17/-17/-17 -16/-16/-16 -11/-11/-11 -12/-12/-12
f -15/-15/-15 -14/-14/-14 -9/-9/-9 -10/-10/-10
f -14/-14/-14 -13/-13/-13 -8/-8/-8 -9/-9/-9
f -13/-13/-13 -12/-12/-12 -7/-7/-7 -8/-8/-8
f -12/-12/-12 -11/-11/-11 -6/-6/-6 -7/-7/-7
f -10/-10/-10 -9/-9/-9 -4/-4/-4 -5/-5/-5
f -9/-9/-9 -8/-8/-8 -3/-3/-3 -4/-4/-4
f -8/-8/-8 -7/-7/-7 -2/-2/-2 -3/-3/-3
f -7/-7/-7 -6/-6/-6 -1/-1/-1 -2/-2/-2
# 16 faces


I didn't know that they can be negative values and didn't implement the library in the way that allows models like this be loaded.
But, assuming that the nagative value means a value that starts not from 0 but from the number of vertexes that the model contains, I rewrote the library so that it handles the model data like this.

http://users.design.ucla.edu/~tatsuyas/tools/objloader/objloader_r08.zip
please donwloaded this library and replace the old library with it.
I tested the model you gave me and it shows a model that seems to be correctly rendered.

thanks!
Re: New Libraries: OBJ Loader, Google Web API
Reply #22 - Jul 16th, 2005, 8:24pm
 
In my current project the models were easy to generate, or to code by hand.. but when i think aboutthe next poject...
Im sure i'll include your name in my prayers CheesyD
Thanks a lot for the:
a.) help
b.) library
c.) both Cheesy
have a nice day
Re: New Libraries: OBJ Loader, Google Web API
Reply #23 - Aug 3rd, 2005, 9:37am
 
Hi SAITO, hi everybody, I am trying to play with Google API but I get the following exception:

Exception in thread "Thread-2" java.lang.NoClassDefFoundError: com/google/soap/search/GoogleSearch

at Temporary_6270_8109.setup(Temporary_6270_8109.java:12)
Re: New Libraries: OBJ Loader, Google Web API
Reply #24 - Aug 8th, 2005, 6:38am
 
I guess you haven't installed Google API .jar file that is contained
in Google API developers kit released by Google. My Google API doesn't
work by itself and it needs the Google API .jar file to search Google.
Please refer to my website for installation.
http://users.design.ucla.edu/~tatsuyas/tools/google/
Re: New Libraries: OBJ Loader, Google Web API
Reply #25 - Aug 22nd, 2005, 11:57am
 
man... hate to give you bad news :)



# Max2Mtl Version 4.0 Mar 10th, 2001

#

newmtl 1_-_Default

material: 1_-_Default

Ka  1.0 0.9 0.7

material ambient: 1.0, 0.9, 0.7

Kd  1.0 0.9 0.7

Ks  0.9 0.9 0.9

d  1.0

material alpha: 1.0

Ns  0.0

illum 2

#

newmtl 2_-_Default

material: 2_-_Default

Ka  0.6 0.8 0.9

material ambient: 0.6, 0.8, 0.9

Kd  0.6 0.8 0.9

Ks  0.9 0.9 0.9

d  1.0

material alpha: 1.0

Ns  0.0

illum 2

#

newmtl 3_-_Default

material: 3_-_Default

Ka  0.0 0.0 0.0

material ambient: 0.0, 0.0, 0.0

Kd  0.0 0.0 0.0

Ks  0.9 0.9 0.9

d  1.0

material alpha: 1.0

Ns  0.0

illum 2

#

newmtl 8_-_Default

material: 8_-_Default

Ka  0.0 0.0 0.0

material ambient: 0.0, 0.0, 0.0

Kd  0.9 0.7 0.8

Ks  1.0 1.0 1.0

d  1.0

material alpha: 1.0

Ns  9.8

illum 2

#

newmtl 7_-_Default

material: 7_-_Default

Ka  0.0 0.0 0.0

material ambient: 0.0, 0.0, 0.0

Kd  0.5 0.5 0.7

Ks  1.0 1.0 1.0

d  1.0

material alpha: 1.0

Ns  9.8

illum 2

#

# EOF

model loaded


java.lang.ArrayIndexOutOfBoundsException: -7
at java.util.Vector.elementAt(Unknown Source)

obj-s can be dloaded from:

http://bituman.ftp.icd.hu/obj/data.rar

the application was your standard example applet, the one that alters the meshes.
bye :D
Re: New Libraries: OBJ Loader, Google Web API
Reply #26 - Sep 2nd, 2005, 1:02pm
 
Given the possiblity of reading from OBJ files, is it possible to write back to them? I'm thinking in terms of creating a path with a Processing application and then exporting that to a 3D modelling suite so it could be tarted up a little. Is that possible? I've downloaded some code by seltar that mapped a 3D object and saved a 3Dmax ascii file:

http://processing.org/discourse/yabb/YaBB.cgi?board=Programs;action=display;num=1110307347;start=1

I intended to sift through it when I got home from the library but I came across this thread in my search for it and it seems like a question worth asking.
Re: New Libraries: OBJ Loader, Google Web API
Reply #27 - Sep 3rd, 2005, 12:32am
 
ok... I will try to investigate this.
It seems you used Max2Mtl converter. I assume that it did something unexpected.

Thanks for the report!

bituman wrote on Aug 22nd, 2005, 11:57am:
man... hate to give you bad news :)

the application was your standard example applet, the one that alters the meshes.
bye :D

Re: New Libraries: OBJ Loader, Google Web API
Reply #28 - Nov 30th, 2005, 1:43pm
 
Unfortunately, it looks like some of the recent changes in processing have caused the OBJ Loader library to stop working. It works fine in 93, but not in 96/7, as I get the following error:
Code:
java.lang.NoSuchFieldError: folder

at saito.objloader.OBJModel.getBufferedReader(OBJModel.java:321)
Re: New Libraries: OBJ Loader, Google Web API
Reply #29 - May 19th, 2006, 3:47pm
 
hi,
does anyone know an easy way to calculate a bounding rect depending on the Y position, i mean the actual width/height drawn to the screen.
i´m working on a project where you can drag and drop 3d elements but i´m stuck at this point.

thanks Christoph
Pages: 1 2 3