[osg-users] obj loader: map_* only reads last component

Ulrich Hertlein u.hertlein at sandbox.de
Wed Jul 23 21:19:02 PDT 2008


Hi Bob, hi Robert,

Robert Osfield wrote:
> The code was written under the assumption that filenames wouldn't have
> spaces...  to handle this one would need to add an extra method into
> the parser to get from a specified position to the end of the line,
> and do the stripping or extraneous spaces that you mentioned.  Feel
> free to dive in and code such as solution.

I submitted a 'fix' a while back because I was getting .obj files that contained 
something like 'map_Kd scale 2.0 2.0 2.0 filename.jpg' to modify the texture matrix.

Since I didn't anticipate filenames with spaces (and didn't have to time/need to 
do the texture matrix stuff) the easy solution was to skip to the last word.

/ulrich



More information about the osg-users mailing list