Hello,

> I have a small problem with the obj loader.
> My OBJ has an entry "mtllib ./cucina.mtl"
>
> On loading I get the following log messages:
>
> INFO:  try to read stream as OBJ GEOMETRY
> INFO:  Check base : c:\Documents and
> Settings\bleile\Documenti\devel\linceoVR\trunk\Resources\models\.\cucina.mtl
> INFO:  Check from pl : c:\Documents and
> Settings\bleile\Documenti\devel\linceoVR\trunk\.\cucina.mtl
> WARNING:  Couldn't open './cucina.mtl'!
>
> The obj file and it's material file are located in "c:\".
>
> The loader is apparently searching for the material in the execution path of
> my program (and additionally in "./Resources/models" ???).

OK, I solved this problem by adding the path in question to
the PathHandler:

osg::PathHandler *pathHandler = osg::SceneFileHandler::the().getPathHandler();

std::string filePath = pathHandler->extractPath( fileName.c_str() );
pathHandler->push_backPath( filePath.c_str() );

// do loading

pathHandler->subPath( filePath.c_str() );

Now it finds the mtl file but there's still a problem:

The loader still returns NullFC because it can't find
a texture that is referenced by the mtl file. How can
I solve that?

Here's the log:

INFO:  Check base : c:\Documents and
Settings\bleile\Documenti\devel\linceoVR\trunk\Resources\models\square.jpg
INFO:  Check from pl : c:\Documents and
Settings\bleile\Documenti\devel\linceoVR\trunk\square.jpg
INFO:  Check from pl : C:/documents and
settings/bleile/Desktop/input/\square.jpg
INFO:  Check base : c:\Documents and
Settings\bleile\Documenti\devel\linceoVR\trunk\Resources\models\
INFO:  Check from pl : c:\Documents and
Settings\bleile\Documenti\devel\linceoVR\trunk\
INFO:  Check from pl : C:/documents and settings/bleile/Desktop/input/\
WARNING:  couldn't find image file

Cheers,

  Toni

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to