Well, I've finally found the problem. It is in Model::readOBJ() method in 
obj.cpp file.

The problem is that sscanf() reads data from *.obj file in default locale.

Qt has the following code inside its QCoreApplication constructor:

Code:
setlocale(LC_ALL, "");                // use correct char set mapping


Which means setting the entire default locale 
(http://www.cplusplus.com/reference/clibrary/clocale/setlocale/). Given that, 
sscanf starts to interpret '.' character as alphabetic in some locales 
(including mine, ru_RU.UTF-8 where floats are divided by ',' symbol). So it 
reads values (for instance, vertex coordinates) until the first '.' appears. 
Now it stops, x coord gets integer part of float and the rest y and z gets 0. 
Then, duplicate search in TriStripifyVisitor finds many, many duplicate and 
only 100 or so unique vertices. As a result, stripify() function works 
extremely slow with such an input data.

I think it should be set "C" locale before reading *.obj file in readOBJ as 
*.obj format is so restrictive and not dependent of current user locale.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41097#41097





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to