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 › objloader and .mtl texture
Page Index Toggle Pages: 1
objloader and .mtl texture (Read 717 times)
objloader and .mtl texture
Dec 8th, 2009, 3:52am
 
I need some help with the objloader library.
My problem is that the .mtl texture doesn't load.
The 3d model loads correctly but i cant load the .mtl texture on it.
Is there any way to do so?
If you can post some working code too...

thanks...
Re: objloader and .mtl texture
Reply #1 - Dec 10th, 2009, 4:20am
 
My .mtl file consists of something like this:
newmtl material_1
Ka 0.200000 0.200000 0.200000
Kd 1.000000 1.000000 1.000000
Ks 1.000000 1.000000 1.000000
Tr 1.000000
illum 2
Ns 0.000000
map_Kd ../images/texture0.jpg

I delete all characters between "map_Kd" and "texture0.jpg" and
leave a blank in there. So lines with texture info look like this:
map_Kd texture0.jpg.
texture0.jpg needs to be in the data folder of the sketch together with the mtl file.
This works for me. Havent done a script for that yet.
Good luck
knutl
Page Index Toggle Pages: 1