Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading an Obj file format using osg OBJPlugin file fails under linux distro with european local. #916

Open
mselim opened this issue Feb 21, 2020 · 3 comments

Comments

@mselim
Copy link

mselim commented Feb 21, 2020

osg 3.6.5
ubuntu 19.10
xubuntu 18.04
gcc 9.2.1
intel hd 620, with mesa 19.3.4

Obj files are not read correctly using osgDB::readNode resulting into osg::Geode with vertices and normals set to 0,0,0,0. While the same code works fine on windows.

I've just re-checked with this fix (using 3.6.5 or directly pulling from master), unfortunately it's not working, but I've managed to know why it's not reading correctly the obj file, it's because environment variable LC_ALL wasn't set by default, it was (this includes almost all ubuntu distros) to nothing (empty). To overcome this issue you have to export on linux your environment variable LC_ALL = POSIX or en_US.UTF-8. I think because I do use a linux distro ubuntu with local set to a European country which floating point decimal mark (",") is different from English US ("."). That's why the parsing of obj not able to read the vertices floating points values correctly because they're written in us comma separated style i.e. x,y,z = 3.34, 6.5656, 0.9875867

@mselim mselim changed the title Reading osg Obj Plugin file fails under linux distro with european local. Reading and Obj file format using osg OBJPlugin file fails under linux distro with european local. Feb 21, 2020
@mselim mselim changed the title Reading and Obj file format using osg OBJPlugin file fails under linux distro with european local. Reading an Obj file format using osg OBJPlugin file fails under linux distro with european local. Feb 21, 2020
@mselim
Copy link
Author

mselim commented Feb 21, 2020

example.zip

@mp3butcher
Copy link
Contributor

Strange, the problem should have been fixed in january with
b063f51

@mp3butcher
Copy link
Contributor

Strange, the problem should have been fixed in january with
b063f51

@mselim please update to current 3.6 branch, infirm the bug and close the issue
thank in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants