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 & HelpOpenGL and 3D Libraries › Loading 3D Models + Textures
Page Index Toggle Pages: 1
Loading 3D Models + Textures (Read 3752 times)
Loading 3D Models + Textures
May 16th, 2005, 4:28am
 
Anyone know any leads for loading 3D model files and using associated textures using processing?

I was hoping to make a simple viewer for some 3D models I've been making (~600 polys), nothing fancy.
Re: Loading 3D Models + Textures
Reply #1 - May 16th, 2005, 11:36am
 
You could check out SAITO's OBJ loading library:

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=os_libraries_tools;action=display;num=1114999115
Re: Loading 3D Models + Textures
Reply #2 - May 16th, 2005, 3:37pm
 
Thanks I've made some good progress with this libary.

Using the MAX2OBJ export plugin for 3DSMax I was able to create an obj and mtl that works (to some degree) with SAITO's library.

MAX2OBJ:
http://www.habware.at/duck6.htm

I couldn't get it work with an internet explorer applet though.
Re: Loading 3D Models + Textures
Reply #3 - May 16th, 2005, 6:48pm
 
you could use some of my script, http://wliia.org/projects/3dcam/, i rewrote the obj-loader to http://www.xs4all.nl/~elout/ this guy, and made it into a class.. not very nice looking though.
And i made a camera-class, but the code is quite tricky, since there's no way of locking the cursor when you're online.. so if you move your mouse slowly around, it works ok, but if you drag it hard, it spins abit..

but i hope you can extract some usefull information from it, and beware, i'm not sure i'm keeping the sketch up for that long, so get it while you can..

-seltar

Re: Loading 3D Models + Textures
Reply #4 - May 17th, 2005, 12:03am
 
Oh I already got a very nice camera working.

Take a look at:

http://mkv25.net/applets/camera_and_3d_mouse/

Right click to rotate.
Middle button to zoom.
Arrow keys move 'block' around.

Press 'c' to centre on block.
Press 'r' to centre on grid.
Re: Loading 3D Models + Textures
Reply #5 - May 17th, 2005, 8:59am
 
funny, i was just on that site, without knowing it was yours, and i copied your script for referance later on Smiley

but my cameraclass is with mouselook (like half life), and that was really not what i was referring to in that script.. it was actually the obj-loader, because that one works online.. you might have to rewrite alot of it though, but it displays obj files with textures, online.. Smiley

-seltar
Re: Loading 3D Models + Textures
Reply #6 - May 17th, 2005, 3:16pm
 
Sorry I just thought I'd mention the camera thing.

I had a go with the code that you provided, I find it much messier and harder to get on with then SAITO's code. I get alot more lost polygons with that code too, but thats probably due to the way I exported.

I also had trouble getting the texture to display properly, the code seems really sensitive to calls to fill() and noFill().

Its just a shame SAITO's doesn't work online :-\
Re: Loading 3D Models + Textures
Reply #7 - May 17th, 2005, 3:23pm
 
yeah, it's alot better than what i got, but what i got works online, so it'll do for now.. let me know if you rewrite it into something beautiful Wink

-seltar
Re: Loading 3D Models + Textures
Reply #8 - May 17th, 2005, 7:57pm
 
http://www.cs.unm.edu/~cello/processing/md2loader2/

md2 loader with bicubic interpolated animation... not ported to latest processing, but a starting point if you're looking into supporting animation.

Marcello
Page Index Toggle Pages: 1